【Material-ui】Material-UI: you are using the deprecated typography variants の警告が出る場合

スポンサーリンク

Material-UI: you are using the deprecated typography variants

Material-UIでテーマをカスタマイズしている場合にこの警告が出る場合があります。警告の文面は以下のような感じ。

Material-UI: you are using the deprecated typography variants that will be removed in the next major release.

内容を読んでみると、次のリリースで削除される属性を使用してるから直した方がいいよ的な感じです。

解決方法としては、下のtypographyオブジェクトの部分を追記します。

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

これでおそらく警告は出なくなるかと思います。

参考ページ↓ どうもロガーのバグみたいな議論になってます。

Typography Migration Error on TextField · Issue #13175 · mui/material-ui
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...

コメント