Skip to content

Commit

Permalink
fix: isMounted issue
Browse files Browse the repository at this point in the history
fix #114
  • Loading branch information
jedwards1211 committed Dec 12, 2022
1 parent 101ce11 commit 8f779ea
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ export function usePopupState({
}): PopupState {
const isMounted = useRef(true)

useEffect(
() => () => {
useEffect((): (() => void) => {
isMounted.current = true
return () => {
isMounted.current = false
},
[]
)
}
}, [])

const [state, _setState] = useState(initCoreState)

Expand Down

0 comments on commit 8f779ea

Please sign in to comment.