-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
Improve Overall Theme Handling #2627
Comments
Correct me if I'm wrong, but I think that we can add the PureRenderMixin to all of our component as soons as they use the muiTheme HOC 💥 |
@oliviertassinari We should move away from using mixins. Why do you think we should use PureRenderMixin? can't we just use a method to check for changes? |
Yeah, yeah, that's an implementation detail 😬. |
I agree we should not use mixins but if @oliviertassinari is right, nothing is stopping us from implementing the pure rendering as another HOC like this. 😄 |
@oliviertassinari I definitely agree with This 👍 👍 Also we won't have to check for context since muiThemeable does it ( I guess this is what you meant 😁 ). @newoga I totally agree. I'm gonna add this before migrating the components. Thanks a lot for the feedbacks 👍 👍 |
Well, I have been giving a lot of thought to this issue. Then, I would refer to #1176 (comment). |
@oliviertassinari Yeah muiTheme should definitely be marked immutable. We better not use any library. We just document the behavior and say: if you want to change the theme you have to make another call to getMuiTheme with whatever property you want to override theme you like before passing it down. And if you want to change theme for a subtree simply wrap the subtree around a MuiThemeProvider. It's rather easy, don't you think? |
I completly agree |
@oliviertassinari Alright. I'm gonna do some research and create a proposal PR with a utility function. 😁 Thanks |
@subjectix Didn't get a chance to say thanks for splitting up the work into multiple PRs! So far it's been a lot easier to review. Thanks! |
@newoga Yeah I was kinda getting a head ache myself 😅 😅 |
Closing this in favour of all the other related issues :) |
After the huge changes made in #2585 it was decided to break the PR into fractions.
The roadmap for changing themes:
The text was updated successfully, but these errors were encountered: