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 Migration Error on TextField

See original GitHub issue

Current Behavior

Some warning about migrating to Typagraphy V2 appeared on my console. I tried to resolve most of them, but an error appears everytime I type on a TextField. The error is as follows:

index.js:2178 Warning: Material-UI: You are using the typography variant body1 which will be restyled in the next major release. Please read the migration guide under https://material-ui.com/style/typography#migration-to-typography-v2

image

Tech Version
Material-UI v3.2.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:16
  • Comments:26 (15 by maintainers)

github_iconTop GitHub Comments

48reactions
ablakeycommented, Oct 10, 2018

Here’s an example of how to make a custom Mui theme that passes in the override config:

import React from 'react';
import { render } from 'react-dom';
import { MuiThemeProvider, createMuiTheme } from '@material-ui/core/styles';
import Root from './Root';

const theme = createMuiTheme({
  typography: {
    useNextVariants: true,
    suppressDeprecationWarnings: true
  }
});

function App() {
  return (
    <MuiThemeProvider theme={theme}>
      <Root />
    </MuiThemeProvider>
  );
}

render(<App />, document.querySelector('#app'));

I found this to be the easiest way to address this issue and move on for now.

23reactions
ablakeycommented, Oct 10, 2018

I’m seeing a lot of typography variant warnings for things I don’t control. I updated all my uses of Typography, but I still get a ton of them, I think, as a result of Material UI components that internally use Typography.

Finding the source is difficult because the trace for these warnings just takes me into the react-dom.development.js dispatch calls and never reveals the original component calling render() that causes this.

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 >
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 >
#32503 (AlterField migration to TextField with default fails on ...
3, running a migration with an AlterField operation that changes a field to a TextField with a default value fails with the error:...
Read more >
Change string to text type in Laravel migration - Stack Overflow
After searching, i found that the err because url is indexed(MySQL error: key specification without a key length).
Read more >
TextField – Attractions
Functional Properties ; error, null, string, The error message to show under the text field. ; autofocus, false, boolean, Whether the field should...
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