export function mergeRefs < T = any > ( refs ) { return ( value ) => { refs . forEach ( ( ref ) => { if ( typeof ref === 'function' ) { ref ( value ) ; } else if ( ref != null ) { ( ref as React . MutableRefObject < T | null > ) . current = value ; } } ) ; } ; } export function composeEventHandlers < E > ( originalEventHandler ? , ourEventHandler ? ) { return function handleEvent ( event ) { originalEventHandler ?. ( event ) ; ourEventHandler ?. ( event ) ; } ; }