UNPKG

use-element-in-view

Version:

A simple React hook to track whether an element is visible in the viewport with the Intersection Observer. This API provides a native way to asynchronously observe changes in the intersection of a target element with an ancestor element or with a top-leve

5 lines (4 loc) 243 B
import { MutableRefObject } from 'react'; export declare function useLatest<T>(value: T): MutableRefObject<T>; export declare function isRefObject(x: any): x is MutableRefObject<HTMLElement>; export declare function hasSupport(): boolean;