Skip to content

Commit

Permalink
fix(ThemeProvider): fix style injection and removal in case multiple …
Browse files Browse the repository at this point in the history
…ThemeProviders are used (#5732)
  • Loading branch information
MarcusNotheis committed Apr 19, 2024
1 parent cf67d3a commit ed6298a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/main/src/components/ThemeProvider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { attachThemeLoaded, detachThemeLoaded } from '@ui5/webcomponents-base/di
import {
getStyleContext,
ThemingParameters,
useIsomorphicId,
useIsomorphicLayoutEffect,
useStylesheet
} from '@ui5/webcomponents-react-base';
Expand All @@ -16,7 +17,8 @@ import { ModalsProvider } from '../Modals/ModalsProvider.js';
import { styleData } from './ThemeProvider.css.js';

function ThemeProviderStyles() {
useStylesheet(styleData, ThemeProvider.displayName);
const uniqueId = useIsomorphicId();
useStylesheet(styleData, `${ThemeProvider.displayName}-${uniqueId}`);
return null;
}

Expand Down

0 comments on commit ed6298a

Please sign in to comment.