Skip to content

Commit ef57237

Browse files
committed
fix: allow html element ref to be null
1 parent 1318990 commit ef57237

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/hooks/useOnClickOutside/useOnClickOutside.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useEventListener } from '../useEventListener';
44

55
type Handler = (event: MouseEvent) => void;
66

7-
export function useOnClickOutside<T extends HTMLElement = HTMLElement>(
7+
export function useOnClickOutside<T extends HTMLElement | null = HTMLElement>(
88
ref: RefObject<T>,
99
handler: Handler,
1010
mouseEvent: 'mousedown' | 'mouseup' = 'mousedown'

0 commit comments

Comments
 (0)