From a3837df57d17a5fd41d1212c124d0bd00bbdd89b Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Tue, 6 Jun 2023 11:36:58 +0200 Subject: [PATCH] theme: switch strategy for avoiding jss class conflict Signed-off-by: Patrik Oldsberg --- packages/theme/src/unified/UnifiedThemeProvider.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/theme/src/unified/UnifiedThemeProvider.tsx b/packages/theme/src/unified/UnifiedThemeProvider.tsx index 41605aee62..613f89d5e0 100644 --- a/packages/theme/src/unified/UnifiedThemeProvider.tsx +++ b/packages/theme/src/unified/UnifiedThemeProvider.tsx @@ -39,10 +39,12 @@ export interface UnifiedThemeProviderProps { noCssBaseline?: boolean; } -// See https://mui.com/x/migration/migration-data-grid-v4/#using-mui-core-v4-with-v5 +// Background at https://mui.com/x/migration/migration-data-grid-v4/#using-mui-core-v4-with-v5 +// Rather than disabling globals and custom seed, we instead only set a production prefix that +// won't collide with MUI 5 styles. We've already got a separate class name generator for v5 set +// up in MuiClassNameSetup.ts, so only the production JSS needs deduplication. const generateV4ClassName = createGenerateClassName({ - disableGlobal: true, - seed: 'mui', // using a slightly shorter prefix than suggested in the docs + productionPrefix: 'jss4-', }); /**