-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
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
[core] Remove withTheme
from @material-ui/core
#26051
Conversation
@@ -174,65 +172,6 @@ const t4: string = createTheme().spacing(1, 2, 3, 4); | |||
// @ts-expect-error | |||
const t5 = createTheme().spacing(1, 2, 3, 4, 5); | |||
|
|||
// withTheme |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
withTheme
utility has been removed from the@material-ui/core/styles
package. You can use the@material-ui/styles/withTheme
instead. Make sure to add aThemeProvider
at the root of your application, as thedefaultTheme
is no longer available. If you are using this utility together with@material-ui/core
, it's recommended you use theThemeProvider
from@material-ui/core/styles
instead.One of the PRs that is necessary for removing
@material-ui/styles
as a dependency of@material-ui/core
.