[core] Remove withTheme from @material-ui/core#26051
Conversation
| // @ts-expect-error | ||
| const t5 = createTheme().spacing(1, 2, 3, 4, 5); | ||
|
|
||
| // withTheme |
There was a problem hiding this comment.
There are tests for this in the @material-ui/styles package.
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
|
Did we intend to keep |
|
I was wondering too. It makes sense for the legacy code that can't be migrated to hooks, no preferences. |
|
I wasn't thinking too much about it to be honest, I am just trying to break the dependencies to |
|
@mnajdova I think that we need to resolve the question of Sebastian. I see two cases based on the answer:
|
|
Isn't it just a prop-injector that injects |
Let's go with option 2. I wouldn't drop anything from |
|
@mnajdova Happy with option 2. The only reason I raised 1 is because of https://styled-components.com/docs/api#withtheme and https://emotion.sh/docs/theming#withthemecomponent-reactcomponenttype-reactcomponenttype. |
The
withThemeutility has been removed from the@material-ui/core/stylespackage. You can use the@material-ui/styles/withThemeinstead. Make sure to add aThemeProviderat the root of your application, as thedefaultThemeis no longer available. If you are using this utility together with@material-ui/core, it's recommended you use theThemeProviderfrom@material-ui/core/stylesinstead.One of the PRs that is necessary for removing
@material-ui/stylesas a dependency of@material-ui/core.