Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[theme] Remove MuiThemeProvider alias #26171

Merged
merged 1 commit into from
May 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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';