I'm new at coding and I'm having the following error when adding a MaterialUI Icon
import PersonIcon from '@mui/icons-material/Person';
function Header() {
return (
<div>
<PersonIcon />
<h2>Header file</h2>
</div>
);
}
export default Header;
When adding I get the following error:
Please notice that I have installed MaterialUI Core and also MaterialUI Icons When not adding everything works fine
CodePudding user response:
Try this
npm uninstall @material-ui/core @material-ui/icons
Then
npm i @material-ui/core @material-ui/icons
Restart the React server
npm start
// OR
yarn start
Let me know if it works, Good Luck