beautiful-react-hooks
Version:
A collection of beautiful (and hopefully useful) React hooks to speed-up your components and hooks development
8 lines (7 loc) • 337 B
TypeScript
import { RefObject } from 'react';
/**
* Uses the IntersectionObserverMock API to tell whether the given DOM Element (from useRef) is visible within the
* viewport.
*/
declare const useViewportSpy: <TElement extends HTMLElement>(ref: RefObject<TElement>, options?: IntersectionObserverInit) => boolean;
export default useViewportSpy;