MCPcopy
hub / github.com/thebuilder/react-intersection-observer / componentDidUpdate

Method componentDidUpdate

src/InView.tsx:87–100  ·  view source on GitHub ↗
(prevProps: IntersectionObserverProps)

Source from the content-addressed store, hash-verified

85 }
86
87 componentDidUpdate(prevProps: IntersectionObserverProps) {
88 // If a IntersectionObserver option changed, reinit the observer
89 if (
90 prevProps.rootMargin !== this.props.rootMargin ||
91 prevProps.root !== this.props.root ||
92 prevProps.threshold !== this.props.threshold ||
93 prevProps.skip !== this.props.skip ||
94 prevProps.trackVisibility !== this.props.trackVisibility ||
95 prevProps.delay !== this.props.delay
96 ) {
97 this.unobserve();
98 this.observeNode();
99 }
100 }
101
102 componentWillUnmount() {
103 this.unobserve();

Callers

nothing calls this directly

Calls 2

unobserveMethod · 0.95
observeNodeMethod · 0.95

Tested by

no test coverage detected