We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 765b80f commit ac64752Copy full SHA for ac64752
lib/modal-hooks.ts
@@ -17,6 +17,8 @@ export function useDialog<T extends string>(
17
const ref = useRef<HTMLDialogElement | null>(null);
18
19
const modalEmitterRef = useRef(new ModalEmitter<T>());
20
+
21
+ // is this a memory leak? it adds a listener on every call
22
const closeEvent = useCallback(
23
() =>
24
new Promise<T | ''>((resolve) => {
@@ -78,6 +80,8 @@ export function useModal<T extends string>(
78
80
const [open, toggleOpen] = useToggle();
79
81
82
83
84
85
86
87
0 commit comments