diff --git a/packages/hooks/src/useUnmountedRef/index.ts b/packages/hooks/src/useUnmountedRef/index.ts index 6a00af71d0..6fdca79910 100644 --- a/packages/hooks/src/useUnmountedRef/index.ts +++ b/packages/hooks/src/useUnmountedRef/index.ts @@ -3,6 +3,8 @@ import { useRef, useEffect } from 'react'; const useUnmountedRef = () => { const unmountedRef = useRef(false); useEffect(() => { + unmountedRef.current = false; + return () => { unmountedRef.current = true; };