Prior Issues
No
What is the current behavior?
useIntersectionObserver state is not reset when target element is changed, like if target is changed to null, the intersection state still report the pervious value
Steps to Reproduce
- use useIntersectionObserver to observe an element and create a button to set the target to null afterwards
What is the expected behavior?
- should handle state when the target of any other options pass to the hooks is changed
Environment Details
- _
@react-hookz/web version: 23.1.0
- _
react version: 18.3.3
- _
react-dom version: 19.0.0
- _
typescript version: 5.7.3
- _OS: Mac
- _Browser: Chrome
- _Did this work in previous versions? No