UNPKG

@spark-web/utils

Version:

--- title: Utilities isExperimentalPackage: true ---

9 lines (8 loc) 426 B
import type { LegacyRef, MutableRefObject, RefCallback } from 'react'; /** * Sometimes we need both a local ref _and_ a forwarded ref for the same element. * This utility merges them for us (as React doesn't offer this natively). * * @see https://github.com/gregberge/react-merge-refs/blob/main/src/index.tsx */ export declare function mergeRefs<T = any>(refs: Array<MutableRefObject<T> | LegacyRef<T>>): RefCallback<T>;