use-is-in-viewport
Version:
A react hook to use the IntersectionObserver declaratively in your React app.
9 lines • 547 B
TypeScript
import { Options } from 'observe-element-in-viewport';
import { MutableRefObject } from 'react';
export declare type CallbackRef = (node: HTMLElement | null) => any;
export declare type HookOptions = Partial<Pick<Options, Exclude<keyof Options, 'viewport'>> & {
viewport: CallbackRef | MutableRefObject<HTMLElement | null>;
target: CallbackRef | MutableRefObject<HTMLElement | null>;
}>;
export default function useIsInViewport(options?: HookOptions): [boolean | null, CallbackRef, CallbackRef];
//# sourceMappingURL=index.d.ts.map