From c2101de63816ae98762679db624ba18faa4c1faf Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Mon, 26 Aug 2024 21:08:29 +0200 Subject: [PATCH] Allow reverting the skipanimation --- packages/x-charts/src/hooks/useReducedMotion.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/x-charts/src/hooks/useReducedMotion.ts b/packages/x-charts/src/hooks/useReducedMotion.ts index 75c361672fac3..d1c89b25611f5 100644 --- a/packages/x-charts/src/hooks/useReducedMotion.ts +++ b/packages/x-charts/src/hooks/useReducedMotion.ts @@ -3,7 +3,7 @@ import { useIsomorphicLayoutEffect, Globals } from '@react-spring/web'; const handleMediaChange = (e: { matches: boolean | undefined }) => { Globals.assign({ // Modification such the react-spring implementation such that this hook can remove animation but never activate animation. - skipAnimation: e.matches || undefined, + skipAnimation: e.matches, }); }; @@ -19,8 +19,6 @@ export const useReducedMotion = () => { useIsomorphicLayoutEffect(() => { const shouldSkipAnimation = - // Skip animation in SSR - typeof window === 'undefined' || // Skip animation test/jsdom !window?.matchMedia;