import { LegacyRef , useRef } from 'react' ; param ref param onClose public export function useLegendAction < T extends HTMLElement > ( ) { const ref = useRef < T > ( null ) ; const onClose = ( ) => { if ( ref . current ) { requestAnimationFrame ( ( ) => ref ?. current ?. focus ?. ( ) ) ; } } ; return [ ref , onClose ] ; }