UNPKG

reactuals

Version:

A useful package providing a collection of 50+ React hooks and utilities to simplify React development.

8 lines (7 loc) 283 B
import { RefObject } from "react"; /** * Detects if a given element is in the viewport. * @param ref - React ref to the element * @param rootMargin - Margin around the root (optional) */ export declare function useOnScreen(ref: RefObject<Element>, rootMargin?: string): boolean;