createMuiTheme 2nd argument type
See original GitHub issueIn the documentation, it states that the 2nd argument of createMuiTheme
is an array, however, while working with it, it turns out to be an object which is merged with the final theme object.
Just a suggestion, it would be great if createMuiTheme can take in a function with default theme as the first argument, just for the purpose of re-using certain values or methods. For Example:
createMuiTheme((theme) => ({
overrides: {
MuiIconButton: {
root: {
borderRadius: "10px",
[theme.breakpoints.down("sm")]: { borderRadius: "0" },
},
},
},
}));
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
createMuiTheme 2nd argument type · Issue #21781 - GitHub
In the documentation, it states that the 2nd argument of createMuiTheme is an array, however, while working with it, it turns out to...
Read more >Typescript and Material UI - pass object to createMuiTheme
See the section "Using createStyles to defeat type widening" from ... You can pass the options directly as argument in createMuiTheme():
Read more >Breaking changes in v5, part one: styles and themes - MUI
This is a reference guide to all of the breaking changes introduced in Material v5, and how to handle them when migrating from...
Read more >Extending the theme in Material UI with TypeScript
Image of code with a typescript error: S2345: Argument of type '{ palette. TypeScript does not allow interfaces to be merged and since ......
Read more >@material-ui/styles | Yarn - Package Manager
... the second argument of onChange (#20541) @samuliasmala; [Tabs] Fix the types ... [core] Fix type definition for createMuiTheme SpacingOptions (#16624) @ ...
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
I can take this one if no one else wants it 😃
@oliviertassinari I think the documentation is sufficient on this one.
It’s an array of attributes and most, but not all, are objects (e.g.
direction
isltr
orrtl
).