1.0.4 • Published 2 years ago
detect-element-viewport v1.0.4
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.