detect-element-viewport
v1.0.4
Published
Detect element is in view
Downloads
2
Readme
To use this package, simply use useRef hook with it.
- Create a ref
- Attach the function useIntersectionObserver with ref
const dataRef = useIntersectionObserver(*triggerRef, {
freezeOnceVisible: false
})
- If the ref is in viewport, the dataRef.isIntersecting will be true.