UNPKG

@primer/components

Version:
11 lines (10 loc) 571 B
import React, { ForwardedRef } from 'react'; /** * Creates a ref by combining multiple constituent refs. The ref returned by this hook * should be passed as the ref for the element that needs to be shared. This is * particularly useful when you are using `React.forwardRef` in your component but you * also want to be able to access the local element. This is a small anti-pattern, * though, as it breaks encapsulation. * @param refs */ export declare function useCombinedRefs<T>(...refs: (ForwardedRef<T> | null | undefined)[]): React.MutableRefObject<T | null>;