diff --git a/packages/mui-private-theming/src/ThemeProvider/ThemeProvider.js b/packages/mui-private-theming/src/ThemeProvider/ThemeProvider.js index 78eee6f0ca023c..37930eaabc72e5 100644 --- a/packages/mui-private-theming/src/ThemeProvider/ThemeProvider.js +++ b/packages/mui-private-theming/src/ThemeProvider/ThemeProvider.js @@ -52,7 +52,8 @@ function ThemeProvider(props) { } const theme = React.useMemo(() => { - const output = outerTheme === null ? localTheme : mergeOuterLocalTheme(outerTheme, localTheme); + const output = + outerTheme === null ? { ...localTheme } : mergeOuterLocalTheme(outerTheme, localTheme); if (output != null) { output[nested] = outerTheme !== null; diff --git a/packages/mui-private-theming/src/useTheme/useTheme.js b/packages/mui-private-theming/src/useTheme/useTheme.js index f1dffd12ccfaa1..43c5f29ed82888 100644 --- a/packages/mui-private-theming/src/useTheme/useTheme.js +++ b/packages/mui-private-theming/src/useTheme/useTheme.js @@ -5,7 +5,8 @@ export default function useTheme() { const theme = React.useContext(ThemeContext); if (process.env.NODE_ENV !== 'production') { - // eslint-disable-next-line react-hooks/rules-of-hooks + // TODO: uncomment once we enable eslint-plugin-react-compiler eslint-disable-next-line react-compiler/react-compiler + // eslint-disable-next-line react-hooks/rules-of-hooks -- It's not required to run React.useDebugValue in production React.useDebugValue(theme); }