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.

Breakpoints override fails in .tsx files

See original GitHub issue

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

github_iconTop GitHub Comments

1reaction
JasonHKcommented, May 4, 2020

I guess that in this case, you could need to augment Breakpoints. Do you have any solution in mind? We recently had a similar concern in #20212.

@oliviertassinari I’ve come up a way to fix this in #20901.

1reaction
oliviertassinaricommented, Mar 26, 2020
Read more comments on GitHub >

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

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