Skip to content

Commit

Permalink
Merge pull request #5950 from marmelab/fix-usesafesetstate-type
Browse files Browse the repository at this point in the history
[TypeScript] Fix compilation fails with @types/react@17
  • Loading branch information
djhi committed Feb 24, 2021
2 parents ea1f85c + 2347636 commit 8c86e3a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/ra-core/src/util/hooks.ts
Expand Up @@ -11,7 +11,9 @@ export function useSafeSetState<T>(
const mountedRef = useRef(false);
useEffect(() => {
mountedRef.current = true;
return () => (mountedRef.current = false);
return () => {
mountedRef.current = false;
};
}, []);
const safeSetState = useCallback(
args => {
Expand Down

0 comments on commit 8c86e3a

Please sign in to comment.