From 22cebdf89a2e51ae3efbaa86588192f690d9589e Mon Sep 17 00:00:00 2001 From: sidorko Date: Wed, 27 Dec 2023 16:15:41 +0300 Subject: [PATCH] fix --- src/components/theme/ThemeProvider.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/theme/ThemeProvider.tsx b/src/components/theme/ThemeProvider.tsx index 7e25311098..ccebe5756d 100644 --- a/src/components/theme/ThemeProvider.tsx +++ b/src/components/theme/ThemeProvider.tsx @@ -38,11 +38,16 @@ export function ThemeProvider({ ) as RealTheme; const themeValue = theme === 'system' ? systemTheme : theme; - const prevRootClassName = React.useRef(''); + const prevRootClassName = React.useRef(''); React.useEffect(() => { if (!scoped) { - updateBodyClassName(themeValue, {'native-scrollbar': nativeScrollbar}, rootClassName, rootClassName.current); + updateBodyClassName( + themeValue, + {'native-scrollbar': nativeScrollbar}, + rootClassName, + prevRootClassName.current, + ); prevRootClassName.current = rootClassName; } }, [nativeScrollbar, themeValue, scoped, rootClassName]);