@@ -23,7 +23,7 @@ function isModifiedEvent(event: MouseEvent) {
2323}
2424
2525export const getRefTarget = (
26- ref : React . RefObject < Element > | Element | null | undefined ,
26+ ref : React . RefObject < Element | null > | Element | null | undefined ,
2727) => ref && ( 'current' in ref ? ref . current : ref ) ;
2828
2929export interface ClickOutsideOptions {
@@ -41,14 +41,14 @@ const InitialTriggerEvents: Partial<Record<MouseEvents, MouseEvents>> = {
4141 * The `useClickOutside` hook registers your callback on the document that fires
4242 * when a pointer event is registered outside of the provided ref or element.
4343 *
44- * @param {Ref<HTMLElement>| HTMLElement } ref The element boundary
44+ * @param {Ref<HTMLElement | null >| HTMLElement } ref The element boundary
4545 * @param {function } onClickOutside
4646 * @param {object= } options
4747 * @param {boolean= } options.disabled
4848 * @param {string= } options.clickTrigger The DOM event name (click, mousedown, etc) to attach listeners on
4949 */
5050function useClickOutside (
51- ref : React . RefObject < Element > | Element | null | undefined ,
51+ ref : React . RefObject < Element | null > | Element | null | undefined ,
5252 onClickOutside : ( e : Event ) => void = noop ,
5353 { disabled, clickTrigger = 'click' } : ClickOutsideOptions = { } ,
5454) {
0 commit comments