[Typography] Deprecated variants error even though none is used.
See original GitHub issueErrors show up on browser console after new typography variants are introduced even though none is used.
- I have searched the issues of this repository and believe that this is not a duplicate.
Expected Behavior
No error
Current Behavior
Browser console shows an error says "Warning: Material-UI: you are using the deprecated typography variants that will be removed in the next major release. Please read the migration guide under https://material-ui.com/style/typography#migration-to-typography-v2"
Steps to Reproduce
- Create new Create-react-app project (non-ejected) with Material UI v3.3.0
- Use Typography component.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:13 (8 by maintainers)
Top Results From Across the Web
[Typography] Deprecated variants error even though none is ...
Errors show up on browser console after new typography variants are introduced even though none is used. I have searched the issues of...
Read more >Deprecated typography warning when using custom theme in ...
I am getting the following warning: Warning: Material-UI: you are using the deprecated typography variants that will be removed in the next ...
Read more >Breaking changes in v5, part two: core components - Material UI
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 >Changelog — Python 3.11.1 documentation
gh-64490: Fix refcount error when arguments are packed to tuple in Argument Clinic. ... It is deprecated to return a value that is...
Read more >Configuring Variants - Tailwind CSS
You can use the special DEFAULT variant to control where the normal, non-prefixed version of a utility is generated relative to the other...
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 confirm that as of
"@material-ui/core": "^3.7.1"
you get the warning even if you are not explicitly using anyTypography
components whatsoever. That said, the error went away when addinguseNextVariants: true,
under thetypography
when creating the theme as directed.@oliviertassinari Hey, after typography v2 if you don’t use one of the migration options you get a console error about it. It doesn’t matter if you use typography component with deprecated variants or not. You get the error/warning.
And even if you do follow the
useNextVariants
way, there is still another thing to apply which is your theme provider component must be the highest component of your root. It doesn’t matter if you use typography components at all. It seems library just warns you to make sure you understand that typography is changed 😄Also, maybe other components like TextField uses typography inside with v1 unless you set
useNextVariants
to true thats why it warns anyway.(not sure)It’s just seems odd to me that if you don’t use typography v1, you shouldn’t get warned. I don’t know if its the intentional behavior, not a big deal though.