packageDocumentation module import * as React from "react" ; /** Callback ref type guard. */ function isRefCallback < T > ( ref ) { return typeof ref === "function" ; } internal export function useRefs < T > ( ... refs ) { return React . useCallback ( ( instance ) => { for ( const ref of refs ) { if ( ref ) { if ( isRefCallback ( ref ) ) { ref ( instance ) ; } else { ( ref as React . MutableRefObject < T | null > ) . current = instance ; } } } } , [ ... refs ] ) ; } internal export function mergeRefs < T > ( ... refs ) { return ( ( instance ) => { for ( const ref of refs ) { if ( ref ) { if ( isRefCallback ( ref ) ) { ref ( instance ) ; } else { ( ref as React . MutableRefObject < T | null > ) . current = instance ; } } } } ) ; }