Skip to content

Commit

Permalink
[material-ui][private-theming] Fix issues reported by react compiler …
Browse files Browse the repository at this point in the history
…in `mui-private-theming` components (#42619)
  • Loading branch information
sai6855 authored Jun 11, 2024
1 parent 2cc5193 commit c7caa1d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion packages/mui-private-theming/src/useTheme/useTheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit c7caa1d

Please sign in to comment.