MCPcopy
hub / github.com/souporserious/react-measure / componentDidMount

Method componentDidMount

src/with-content-rect.js:41–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39 _window = null
40
41 componentDidMount() {
42 this._resizeObserver = (this._window !== null && this._window.ResizeObserver)
43 ? new this._window.ResizeObserver(this.measure)
44 : new ResizeObserver(this.measure);
45 if (this._node !== null) {
46 this._resizeObserver.observe(this._node)
47
48 if (typeof this.props.onResize === 'function') {
49 this.props.onResize(
50 getContentRect(this._node, types || getTypes(this.props))
51 )
52 }
53 }
54 }
55
56 componentWillUnmount() {
57 if (this._window !== null) {

Callers

nothing calls this directly

Calls 2

getContentRectFunction · 0.85
getTypesFunction · 0.85

Tested by

no test coverage detected