UNPKG

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) 354 B
import { type 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 | undefined; export default useViewportSpy;