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 8f5b9f3 commit 4f916d7Copy full SHA for 4f916d7
src/react-headless-nested-menu.tsx
@@ -133,6 +133,9 @@ export const useNestedMenu = ({
133
if (state.isOpen) {
134
document.addEventListener('click', globalClickHandler)
135
}
136
+ return () => {
137
+ document.removeEventListener('click', globalClickHandler)
138
+ }
139
}, [state.isOpen, globalClickHandler])
140
141
const toggleMenu = () => {
0 commit comments