Breakpoints override fails in .tsx files
See original GitHub issueOverriding breakpoints through createMuiTheme fails in typescript files.
Current Behavior 😯
Typescript throws
Argument of type '"xlg"' is not assignable to parameter of type 'number | "xs" | "sm" | "md" | "lg" | "xl"'.ts(2345)
when breakpoint has been overridden correctly.
Expected Behavior 🤔
Breakpoint should override in makeStyles.
Steps to Reproduce 🕹
createMuiTheme function
createMuiTheme({ breakpoints: { keys: ["xs", "sm", "md", "lg", "xlg", "xl"], values: { xs: 0, sm: 600, md: 960, lg: 1280, xlg: 1872, xl: 1920 } },
use in makeStyles
[theme.breakpoints.down("xlg")]: { content:
‘Screen size = xlg’ },
xlg throws error in vscode.
Your Environment 🌎
Tech | Version |
---|---|
Material-UI | v4.9.2 |
TypeScript | v3.6.3 |
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Breakpoints override fails in .tsx files · Issue #20292 - GitHub
Overriding breakpoints through createMuiTheme fails in typescript files. Current Behavior. Typescript throws
Read more >material-ui container doesn't work with custom breakpoints on ...
From reading the material-ui docs, I think the Container components maxWidth attribute only accepts the following values:
Read more >How to Debug TypeScript Files with Chrome Browser - Medium
This is a really useful way to debug TypeScript files, and it isn't difficult at all, ... Then we need to add breakpoint...
Read more >ts-jest - npm
ts-jest is a TypeScript preprocessor with source map support for Jest that lets you use Jest to test projects written in TypeScript.
Read more >wordpress/scripts | Block Editor Handbook
This is a collection of reusable scripts tailored for WordPress development. For convenience, every tool provided in this package comes with…
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
@oliviertassinari I’ve come up a way to fix this in #20901.
You need to augment the theme: https://material-ui.com/guides/typescript/#customization-of-theme.