import { withStyles } from "@material-ui/core/styles";Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
installed using yarn install@material-ui/core
old version deleted
| Tech | Version |
|--------------|---------|
| Material-UI | 1.0.0-rc.0 |
| React | 16.3.2 |
| browser | Chrome v66.0.3359.139 |
{
"name": "react-chat",
"version": "0.1.0",
"private": true,
"dependencies": {
"@material-ui/core": "^1.0.0-rc.0",
"@material-ui/icons": "^1.0.0-rc.0",
"classnames": "^2.2.5",
"material-ui": "^1.0.0-beta.47",
"react": "^16.3.2",
"react-dom": "^16.3.2",
"react-router-dom": "^4.2.2",
"react-scripts": "1.1.4",
"typeface-roboto": "^0.0.54"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
@vladseverin You might have forgotten some imports. Don't miss our codemod to fix all the occurrences: https://github.com/mui-org/material-ui/blob/master/packages/material-ui-codemod/README.md#import-path.
@oliviertassinari Instead of saying warning [email protected]: You can now upgrade to @material-ui/core, how about instead linking to that README? Would have saved me a bunch of time and effort.
@octavioamu Also, the README instructions are for .js and I use .ts and .tsx. They also do not properly escape the @ in the shell, so the path isn't found.
@octavioamu Yep, as I suspected. No typescript support in jscodemod.
@oliviertassinari Thanks for the link, solved the problem by automatically changing paths
Most helpful comment
@vladseverin You might have forgotten some imports. Don't miss our codemod to fix all the occurrences: https://github.com/mui-org/material-ui/blob/master/packages/material-ui-codemod/README.md#import-path.