/** * Hook that uses `IntersectionObserver` to trigger `onIntersect` callback when element is in viewport. * Callback is called only once by default (can be changed using the `once` parameter). * @returns a callback ref that needs to be set on the element you want to observe. * @private * @example * const onIntersection = React.useCallback(() => { * console.log('Element is in viewport!'); * }, []); * const ref = useIntersection(onIntersection); * return (