Skip to content

Commit

Permalink
fix(ThemeProvider): always set CSS class when scoped (#1423)
Browse files Browse the repository at this point in the history
  • Loading branch information
amje authored Mar 14, 2024
1 parent 1e8ff11 commit c787b5b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/components/theme/ThemeProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,14 @@ export function ThemeProvider({
[systemLightTheme, systemDarkTheme],
);

const isNeedToSetTheme = !hasParentProvider || themeValue !== parentThemeState.themeValue;
return (
<ThemeContext.Provider value={contextValue}>
<ThemeSettingsContext.Provider value={themeSettingsContext}>
{scoped ? (
<div
className={b(
{
theme: isNeedToSetTheme && themeValue,
theme: themeValue,
'native-scrollbar': nativeScrollbar !== false,
},
rootClassName,
Expand Down

0 comments on commit c787b5b

Please sign in to comment.