import { KeyboardEvent , useCallback } from 'react' ; import { ValueType , UseSelectProps } from '../../../types' ; const useEscapeKeyDownHandler = < T extends ValueType , M extends boolean = false > ( { selectState : { close } } ) => useCallback ( ( event ) => { event . preventDefault ( ) ; close ( ) ; } , [ close ] ) ; export default useEscapeKeyDownHandler ;