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.

[Typography] Deprecated variants error even though none is used.

See original GitHub issue

Errors 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"

error

Steps to Reproduce

  1. Create new Create-react-app project (non-ejected) with Material UI v3.3.0
  2. Use Typography component.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

5reactions
blainegarrettcommented, Dec 29, 2018

I can confirm that as of "@material-ui/core": "^3.7.1" you get the warning even if you are not explicitly using any Typography components whatsoever. That said, the error went away when addinguseNextVariants: true, under the typography when creating the theme as directed.

const muiTheme = createMuiTheme({
  typography: {
    useNextVariants: true,
    fontFamily: ...,
 }
 ...
});
4reactions
orhunerdemcommented, Oct 23, 2018

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

Read more comments on GitHub >

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

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