File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -18,11 +18,11 @@ import { useKeyDownHandlers } from './useKeyDownHandlers';
1818 * @param passedRef - Optional ref to the modal element. If not provided, one is created internally.
1919 * @returns A ref to be attached to the modal DOM element
2020 */
21- export function useModalClose (
21+ export function useModalClose < T extends HTMLElement = HTMLElement > (
2222 onClose : ( ) => void ,
23- passedRef ?: MutableRefObject < HTMLElement | null >
24- ) : MutableRefObject < HTMLElement | null > {
25- const createdRef = useRef < HTMLElement | null > ( null ) ;
23+ passedRef ?: MutableRefObject < T | null >
24+ ) : MutableRefObject < T | null > {
25+ const createdRef = useRef < T | null > ( null ) ;
2626 const modalRef = passedRef ?? createdRef ;
2727
2828 useEffect ( ( ) => {
You can’t perform that action at this time.
0 commit comments