Lab theme augmentation instructions cause syntax error
See original GitHub issue- The issue is present in the latest release.
- I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯
The “About the lab” docs suggest adding this line when creating the MUI theme:
import type '@material-ui/lab/themeAugmentation';
which causes error TS1005: '=' expected.
Expected Behavior 🤔
The import suggested by the docs doesn’t cause a syntax error. I’ve filed https://github.com/microsoft/TypeScript/issues/40051 to suggest this as a TypeScript feature, but in the mean time we may suggest the import be:
import '@material-ui/lab/themeAugmentation'
Your Environment 🌎
Tech | Version |
---|---|
Material-UI | v4.11.0 |
TypeScript | v3.9.7 |
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Lab theme augmentation instructions cause syntax error #22203
The issue is present in the latest release. I have searched the issues of this repository and believe that this is not a...
Read more >@mui/lab | Yarn - Package Manager
@mui/lab. This package hosts the incubator components that are not yet ready to move to core . Installation. Install the package in your...
Read more >Extending Material UI theme via Module Augmentation not ...
I'm trying to extend Theme with Material UI, but it's throwing an error, saying that I'm not extending it correctly, saying,
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 >mui/material/CHANGELOG.md - UNPKG
05 --> [lab] Use the public API for module augmentation (#27735) @oliviertassinari ... 22 -->[docs] Fix syntax error in v5 migration `styled` api...
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
Actually @oliviertassinari i just discovered that
import '@material-ui/lab/themeAugmentation'
actually emits a runtime import which isn’t ideal. That’s by design for side-effect imports. Maybe we have a better suggestion until TypeScript possibly implements https://github.com/microsoft/TypeScript/issues/40051?I used in my code base:
@fcole90 Yeah, if you use the docs of v5, you also need to have v5 installed 😃