Watch an element's position in or out of the view with IntersectionObserver
IntersectionObserver
const [ ref, inView ] = useInView(intersectionObserverOptions)