From 2347636832ff5b35e31d1c1cddac5b9abab084fd Mon Sep 17 00:00:00 2001 From: fzaninotto Date: Wed, 24 Feb 2021 08:22:39 +0100 Subject: [PATCH] [TypeScript] Fix compilation fails with @types/react@17 Closes #5949 --- packages/ra-core/src/util/hooks.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/ra-core/src/util/hooks.ts b/packages/ra-core/src/util/hooks.ts index 5c453a113bd..19e827b70fc 100644 --- a/packages/ra-core/src/util/hooks.ts +++ b/packages/ra-core/src/util/hooks.ts @@ -11,7 +11,9 @@ export function useSafeSetState( const mountedRef = useRef(false); useEffect(() => { mountedRef.current = true; - return () => (mountedRef.current = false); + return () => { + mountedRef.current = false; + }; }, []); const safeSetState = useCallback( args => {