createMuiTheme overrides not working since 4.9.6
See original GitHub issuecreateMuiTheme
overrides not working since 4.9.6
Since https://github.com/mui-org/material-ui/issues/20095, the isPlainObject has been modified.
Testing constructor
property is not multi-frame proof.
This makes deepmerge
do not merge incomming properties from given source
when source
is an Object created in another js context like another document iframe.
- [X ] The issue is present in the latest release.
- [ X] I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯
The generated jss style does not conatin overrides, so desired style is not applied to components.
Expected Behavior 🤔
The generated jss style must contain overrides in order to have the desired styles applied to components.
Tech | Version |
---|---|
Material-UI | v4.1.11 |
React | 16.14 |
Browser | all |
TypeScript | no |
etc. |
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (5 by maintainers)
Top Results From Across the Web
createMuiTheme overrides not working since 4.9.6 #23739
The generated jss style must contain overrides in order to have the desired styles applied to components. Tech, Version. Material-UI, v4.1.11.
Read more >Material UI Select override Position in theme - reactjs
The overrides key is for overriding styles. You should use the props key for defaulting props in the theme. Here's the correct syntax:...
Read more >can't resolve '@material-ui/core/styles/createmuitheme'
MaterialUI TextField : changing background color is not working as it is ... You can instead override the background-color on the FilledInput as...
Read more >material-ui/core/CHANGELOG.md
8, Please report issues with the deprecations on ... 219, - Simplify the theme overrides with TypeScript for the components in the lab...
Read more >override input styling from theme
override input styling from theme ... Activating extension 'vscode.typescript-language-features' failed: Could not find bundled tsserver.js.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@eps1lon I’m asking because it doesn’t seem to be something we fundamentally prevent from supporting. As far as I know, It’s not blocking. Developers can bypass the
deepmerge
method, by bypassing thecreateMuiTheme()
method. Hence why I’m eager to have a reproduction to better understand the use case.We know that multi-frame support is rarely used but we still support it. I suspect this specific case is unique and nonblocking. A drop in the bucket most developers would rather have us ignore (not pay the cost for it). Not every bug deserved to be fixed. I think that it’s a big factor in the “write your own” popularity, it allows different tradeoffs (but also come with ignoring problems you don’t know you have).
https://github.com/mui-org/material-ui/pull/23740#issuecomment-734486617
Before all, thanks for your fast reply!
I understand that edge cases do not justify increasing bundle size 👍.
I’ve created a PR just to show the case, the goal was not really o be merged 😉 (the isPlainObject code is borrowed from lodash). I wanted to point out that:
constructor
to test if it’s a plain object is not the more resilient technique and should be reconsidered. If you don’t like lodash implementation, as you said, you might find other techniques. This change was introduced here https://github.com/mui-org/material-ui/issues/20095, so if in v5 you are planning to remove support of this popper version, you sould reconsider (again) to not useconstructor
technique.In my current case, I CAN NOT upgrade material-ui up to 4.9.5 for now.