Skip to content

Commit

Permalink
[theme] Remove MuiThemeProvider alias (#26171)
Browse files Browse the repository at this point in the history
  • Loading branch information
m4theushw committed May 7, 2021
1 parent e51737a commit 21ec808
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
9 changes: 9 additions & 0 deletions docs/src/pages/guides/migration-v4/migration-v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -1512,6 +1512,15 @@ As the core components use emotion as a styled engine, the props used by emotion
+import { jssPreset } from '@material-ui/styles';
```

#### MuiThemeProvider

- The `MuiThemeProvider` is no longer exported from `@material-ui/core/styles`. Use `ThemeProvider` instead.

```diff
-import { MuiThemeProvider } from '@material-ui/core/styles';
+import { ThemeProvider } from '@material-ui/core/styles';
```

#### ServerStyleSheets

- The `ServerStyleSheets` is no longer exported from `@material-ui/core/styles`. You should import it directly from `@material-ui/styles`.
Expand Down
6 changes: 3 additions & 3 deletions framer/Material-UI.framerfx/code/ThemeProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { addPropertyControls, ControlType } from 'framer';
import { MuiThemeProvider, createTheme } from '@material-ui/core/styles';
import { ThemeProvider, createTheme } from '@material-ui/core/styles';
import { parseColor } from './utils';

interface Props {
Expand Down Expand Up @@ -40,9 +40,9 @@ export function Theme(props: Props): JSX.Element {
});

return (
<MuiThemeProvider theme={theme} {...other}>
<ThemeProvider theme={theme} {...other}>
{children}
</MuiThemeProvider>
</ThemeProvider>
);
}

Expand Down
6 changes: 1 addition & 5 deletions packages/material-ui/src/styles/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,7 @@ export {
StyledComponentProps,
} from './withStyles';
export { default as experimentalStyled, CreateMUIStyled } from './experimentalStyled';
export {
default as MuiThemeProvider,
default as ThemeProvider,
ThemeProviderProps,
} from './ThemeProvider';
export { default as ThemeProvider, ThemeProviderProps } from './ThemeProvider';
export {
createGenerateClassName,
jssPreset,
Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui/src/styles/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ export { default as useTheme } from './useTheme';
export { default as unstable_useThemeProps } from './useThemeProps';
export { default as withStyles } from './withStyles';
export { default as experimentalStyled } from './experimentalStyled';
export { default as MuiThemeProvider, default as ThemeProvider } from './ThemeProvider';
export { default as ThemeProvider } from './ThemeProvider';

0 comments on commit 21ec808

Please sign in to comment.