UNPKG

react-animate-observer

Version:

A React component for scroll animations using Intersection Observer

12 lines (11 loc) 1.08 kB
import { IntersectionObserverProps } from '../animation/types'; /** * @typedef {Object} IntersectionObserverProps * @property {number} [mediaQueryWidth] - The minimum viewport width in pixels. * @property {string} [largeScreenRootMargin] - The root margin to use when the viewport width is greater than or equal to mediaQueryWidth. * @property {string} [smallScreenRootMargin] - The root margin to use when the viewport width is less than mediaQueryWidth. * @property {number} [threshold] - A number indicating at what percentage of the target's visibility the observer's callback should be executed. * @property {boolean} [once] - Whether to only update the inView state once when the observed element enters the viewport. */ declare const useIntersectionObserver: ({ mediaQueryWidth, largeScreenRootMargin: _largeScreenRootMargin, smallScreenRootMargin: _smallScreenRootMargin, threshold: _threshold, once, }: IntersectionObserverProps) => (boolean | import("react").Dispatch<import("react").SetStateAction<HTMLElement | null>>)[]; export default useIntersectionObserver;