Template
Update AGENTS.md. Start fixing old weird errors
This commit is contained in:
1 parent
0bc04dbf6b
commit
d16f4287ce
96 files changed
+18195
-9182
No files matched your search
@@ -9,12 +9,12 @@ type EventType =
|
||||
| 'focusin'
|
||||
| 'focusout';
|
||||
|
||||
export function useOnClickOutside<T extends HTMLElement = HTMLElement>(
|
||||
export const useOnClickOutside = <T,>(
|
||||
ref: React.RefObject<T | null> | React.RefObject<T | null>[],
|
||||
handler: (event: MouseEvent | TouchEvent | FocusEvent) => void,
|
||||
eventType: EventType = 'mousedown',
|
||||
eventListenerOptions: AddEventListenerOptions = {},
|
||||
): void {
|
||||
): void => {
|
||||
const savedHandler = React.useRef(handler);
|
||||
|
||||
React.useLayoutEffect(() => {
|
||||
@@ -55,6 +55,6 @@ export function useOnClickOutside<T extends HTMLElement = HTMLElement>(
|
||||
);
|
||||
};
|
||||
}, [ref, eventType, eventListenerOptions]);
|
||||
}
|
||||
};
|
||||
|
||||
export type { EventType };
|
||||
Reference in new issue
Block a user