Skip to content

Commit

Permalink
[styles] Keep MuiThemeProvider for backward compatibility (#15650)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed May 10, 2019
1 parent 65ed42e commit 37d5d6c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
9 changes: 1 addition & 8 deletions docs/src/pages/guides/migration-v3/migration-v3.md
Expand Up @@ -83,13 +83,6 @@ yarn add @material-ui/styles@next
- ⚠️ Material-UI depends on JSS v10. JSS v10 is not backward compatible with v9.
Make sure JSS v9 is not installed in your environment.
Removing `react-jss` from your package.json can help.
- Isolation of the styling solution of the core components in a dedicated package.
Remove the `MuiThemeProvider` component:

```diff
-import { MuiThemeProvider } from '@material-ui/core/styles';
+import { ThemeProvider } from '@material-ui/styles';
```
- Remove the first option argument of `withTheme()`.
The first argument was a placeholder for a potential future option.
We have never found a need for it.
Expand Down Expand Up @@ -193,7 +186,7 @@ yarn add @material-ui/styles@next
+<Fab />
```

- [ButtonBase] The component passed to the `component` prop needs to be able to hold a ref.
- [ButtonBase] The component passed to the `component` prop needs to be able to hold a ref.
The [composition guide](/guides/composition/#caveat-with-refs) explains the migration strategy.

This also applies to `BottomNavigationAction`, `Button`, `CardActionArea`, `Checkbox`, `ExpansionPanelSummary`, `Fab`, `IconButton`, `MenuItem`, `Radio`, `StepButton`, `Tab`, `TableSortLabel` as well as `ListItem` if the `button` prop
Expand Down
3 changes: 3 additions & 0 deletions packages/material-ui/src/styles/MuiThemeProvider.d.ts
@@ -0,0 +1,3 @@
import { ThemeProvider } from '@material-ui/styles';

export default ThemeProvider;
3 changes: 1 addition & 2 deletions packages/material-ui/src/styles/MuiThemeProvider.js
@@ -1,7 +1,6 @@
import { ThemeProvider } from '@material-ui/styles';

/**
* @ignore - internal component.
* @deprecated
* @ignore - do not document.
*/
export default ThemeProvider;
1 change: 1 addition & 0 deletions packages/material-ui/src/styles/index.d.ts
Expand Up @@ -8,6 +8,7 @@ export {
export { default as createStyles } from './createStyles';
export { TypographyStyle } from './createTypography';
export { default as makeStyles } from './makeStyles';
export { default as MuiThemeProvider } from './MuiThemeProvider';
export { default as responsiveFontSizes } from './responsiveFontSizes';
export { ComponentsPropsList } from './props';
export * from './transitions';
Expand Down

0 comments on commit 37d5d6c

Please sign in to comment.