question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

createMuiTheme 2nd argument type

See original GitHub issue

In 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.

image

image

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:closed
  • Created 3 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
DanailHcommented, Jul 20, 2020

I can take this one if no one else wants it 😃

1reaction
kgregorycommented, Jul 19, 2020

@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 is ltr or rtl).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found