Deprecated
Use the new signature with an unique option object instead. Custom hook for tracking the intersection of a DOM element with its containing element or the viewport.
import { useIntersectionObserver } from "https://deno.land/x/netzo@0.5.70/deps/usehooks-ts.ts";
Examples
const targetRef = useRef(null);
const options = { threshold: 0.5 };
const entry = useIntersectionObserver(targetRef, options);
// Access the intersection details from the entry variable.
const targetRef = useRef(null); const options = { threshold: 0.5 }; const entry = useIntersectionObserver(targetRef, options); // Access the intersection details from the entry variable.
Parameters
elementRef: RefObject<Element>
- The ref object for the DOM element to observe.