Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sidorko authored Dec 27, 2023
1 parent c5f22ed commit 22cebdf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/theme/ThemeProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,16 @@ export function ThemeProvider({
) as RealTheme;
const themeValue = theme === 'system' ? systemTheme : theme;

const prevRootClassName = React.useRef<string>('');
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]);
Expand Down

0 comments on commit 22cebdf

Please sign in to comment.