UNPKG

reakit-utils

Version:

Reakit utils

16 lines (15 loc) 528 B
import * as React from "react"; /** * Merges up to two React Refs into a single memoized function React Ref so you * can pass it to an element. * * @example * import React from "react"; * import { useForkRef } from "reakit-utils"; * * const Component = React.forwardRef((props, ref) => { * const internalRef = React.useRef(); * return <div {...props} ref={useForkRef(internalRef, ref)} />; * }); */ export declare function useForkRef(refA?: React.Ref<any>, refB?: React.Ref<any>): ((value: any) => void) | null;