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

Method observeNode

src/InView.tsx:106–133  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

104 }
105
106 observeNode() {
107 if (!this.node || this.props.skip) return;
108 const {
109 threshold,
110 root,
111 rootMargin,
112 trackVisibility,
113 delay,
114 fallbackInView,
115 } = this.props;
116
117 if (this.lastInView === undefined) {
118 this.lastInView = this.props.initialInView;
119 }
120 this._unobserveCb = observe(
121 this.node,
122 this.handleChange,
123 {
124 threshold,
125 root,
126 rootMargin,
127 // @ts-expect-error
128 trackVisibility,
129 delay,
130 },
131 fallbackInView,
132 );
133 }
134
135 unobserve() {
136 if (this._unobserveCb) {

Callers 3

componentDidMountMethod · 0.95
componentDidUpdateMethod · 0.95
InViewClass · 0.95

Calls 1

observeFunction · 0.90

Tested by

no test coverage detected