Material-ui: DialogContentText is throwing deprecated typography variant warning in 3.2

Created on 8 Oct 2018  路  4Comments  路  Source: mui-org/material-ui

The DialogContentText component uses variant="subheading" (https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/DialogContentText/DialogContentText.js#L17), so it is getting a deprecation warning.

I would prefer not to disable the deprecation warnings completely, as they are helpful for rooting out old variants I may have missed in my migration. Is there an expected course of action here? Sorry if I missed it in the docs or in any of the typography v2 PRs.

  • [x] This is not a v0.x issue.
  • [x] I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

Maybe the deprecation warning can be ignored for code in the Material UI library itself?

Current Behavior

Code in the core library is throwing the deprecation warning.

Steps to Reproduce

  1. Open the live example: https://codesandbox.io/s/52yrwx8kjn
  2. Click the button
  3. Look at the console

Your Environment

| Tech | Version |
|--------------|---------|
| Material-UI | v3.2.0 |
| React | 16.5.2 |
| Browser | Chrome |

bug 馃悰 Typography

Most helpful comment

I'm also getting the warning when using default Tooltip component to wrap a custom <span>. I also have set useNextVariants: true. Any clue?

All 4 comments

Enabling typography v2 should do the trick. Doing this will still warn if you use deprecated variants in your codebase.

By "Enabling typography v2" do you mean setting useNextVariants: true? The warning is still thrown when this is set: https://codesandbox.io/s/k0jryxq9n7. Or is there another setting I should use?

@mcdougal Thank you for the report. We have forgotten to add the internalDeprecatedVariant property on:
https://github.com/mui-org/material-ui/blob/c01df420db491965ac035af55c2f956e4f0fb885/packages/material-ui/src/DialogContentText/DialogContentText.js#L17

I'm also getting the warning when using default Tooltip component to wrap a custom <span>. I also have set useNextVariants: true. Any clue?

Was this page helpful?
0 / 5 - 0 ratings