UNPKG

rc-scroll-into-view

Version:

Solving the issue of scrollIntoView failing during asynchronous scrolling in JavaScript.

7 lines (6 loc) 391 B
import type { MutableRefObject } from "react"; type TargetValue<T> = T | undefined | null; type TargetType = HTMLElement | Element | Window | Document; export type BasicTarget<T extends TargetType = Element> = TargetValue<T> | MutableRefObject<TargetValue<T>>; export declare function getTarget<T extends TargetType>(target: BasicTarget<T>, defaultElement?: T): T; export default getTarget;