IntersectionObserverEntry is undefined until element is in view #739
-
|
I have a setup using the const {ref: refA, inView: aInView, entry: entryA} = useInView();
const {ref: refB, inView: bInView, entry: entryB} = useInView();
const {ref: refC, inView: cInView, entry: entryC} = useInView();
...
<button onClick={() => entryA.target.scrollIntoView()}>Go to A</button>
<button onClick={() => entryB.target.scrollIntoView()}>Go to B</button>
<button onClick={() => entryC.target.scrollIntoView()}>Go to C</button>
...
<div ref={refA}>...</div>
<div ref={refB}>...</div>
<div ref={refC}>...</div>This worked fine until the release of V10.0.0, since which the behavior of |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
I would assign my own |
Beta Was this translation helpful? Give feedback.
I would assign my own
refto thediv, instead of relying on theentry. Therefcan be merged with the one fromuseInView.