()
| 122 | ); |
| 123 | |
| 124 | function stopObserving() { |
| 125 | // Centralized teardown so both manual destroys and React ref updates share |
| 126 | // the same cleanup path (needed for React versions that never call the ref with `null`). |
| 127 | if (destroyed) return; |
| 128 | destroyed = true; |
| 129 | destroyObserver(); |
| 130 | observedElementRef.current = null; |
| 131 | observerCleanupRef.current = undefined; |
| 132 | lastInViewRef.current = undefined; |
| 133 | } |
| 134 | |
| 135 | observerCleanupRef.current = stopObserving; |
| 136 |
no outgoing calls
no test coverage detected
searching dependent graphs…