Skip to content

Commit 701b306

Browse files
committed
fix: useMountedState should not change state on componentDidUpdate lifecycle
1 parent d45f038 commit 701b306

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/useMountedState.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default function useMountedState(): () => boolean {
1010
return () => {
1111
mountedRef.current = false;
1212
};
13-
});
13+
}, []);
1414

1515
return get;
1616
}

0 commit comments

Comments
 (0)