const theme = createMuiTheme({
typography: {
useNextVariants: true,
},
});
in both my client.js and server.js , but still whenever I open my console, I receive this error:
index.js:1 Warning: Failed prop type: "deprecatedVariants" is read-only
in Typography (created by WithStyles(Typography))
in WithStyles(Typography) (at Layout.js:111)
in div (created by Toolbar)
in Toolbar (created by WithStyles(Toolbar))
in WithStyles(Toolbar) (at Layout.js:99)
in header (created by Paper)
in Paper (created by WithStyles(Paper))
in WithStyles(Paper) (created by AppBar)
in AppBar (created by WithStyles(AppBar))
in WithStyles(AppBar) (at Layout.js:92)
in div (at Layout.js:86)
in Layout (created by WithStyles(Layout))
in WithStyles(Layout) (created by WithStyles(WithStyles(Layout)))
in WithStyles(WithStyles(Layout)) (created by Connect(WithStyles(WithStyles(Layout))))
in Connect(WithStyles(WithStyles(Layout))) (at home/index.js:19)
in MuiThemeProvider (at client.js:101)
in App (at client.js:100)
Any suggestions to solve this issue?
Note : My WithStyles is @material-ui/core/styles && withStyle is isomorphic-style-loader/lib/withStyles
_Originally posted by @Arrow891 in https://github.com/mui-org/material-ui/issues/12741#issuecomment-430518133_
@Arrow891 Upgrade to @material-ui/core@^3.2.2
@eps1lon Already done, but the error still persists
@Arrow891 Please provide a reproduction example. You can even use codesandbox for SSR issues like I did here: https://github.com/facebook/react/issues/13838. But I believe that upgading to v3.2.2 should be enough
@Arrow891 Please remove your node_modules, install again and post (depending on your package manager) yarn list --pattern @material-ui/core or npm ls @material-ui/core
@eps1lon Great! I've done these steps and the error has gone :
npm cache clean --force
removed node_modules and then the issue has been fixed when I reinstalled node packages, thanks for your support.
@oliviertassinari If I could do that, many of my problems would be solved, but based on the company's regulations, I am prohibited to use unverified tools, but thank you anyway, I will use this solution for my future questions out of the firm.
@eps1lon Already done, but the error still persists
I have solved the issue by upgradiing to @material-ui/core@^3.2.2 and adding
typography: {
useNextVariants: true
},
while creating Theme.