From 701b306ed97382cbec73c834f6d3dd7baa58e339 Mon Sep 17 00:00:00 2001 From: WhiteMinds Date: Wed, 16 Sep 2020 10:47:33 +0800 Subject: [PATCH] fix: useMountedState should not change state on componentDidUpdate lifecycle --- src/useMountedState.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/useMountedState.ts b/src/useMountedState.ts index b4be5aeb6c..3bdabe8685 100644 --- a/src/useMountedState.ts +++ b/src/useMountedState.ts @@ -10,7 +10,7 @@ export default function useMountedState(): () => boolean { return () => { mountedRef.current = false; }; - }); + }, []); return get; }