Hi iam using react with material ui core.
I get the error you see in the title when iam trying to use the new box inside of typography component.
import Typography from "@material-ui/core/Typography";
import { unstable_Box as Box } from "@material-ui/core/Box";
function sayHello() {
return (
<div >
<Typography>
<Box textAlign="left">Hello</Box>
</Typography>
</div>
);}
I have updated material ui core to the new version 3.8.1. I have also updated material ui next but error still exists. Please help. How to use the new material ui component ? Please help.
To solve the error "Module not found: Error: Can't resolve '@mui/material'", make sure to install the package by opening your terminal in your project's root directory and running the command npm i @mui/material @emotion/react @emotion/styled and restart your development server.
In order to use makeStyles function in your application you will need to import it in the component in where you plan to access the css that results from your makeStyles function. This is assuming you have already installed Material Ui in your project. This is in order for react to recognize it as a styles file.
@mui/styles v5 is not compatible with React 18 · Issue #32142 · mui/material-ui · GitHub.
you need to run yarn add @material-ui/styles@next
or npm install @material-ui/styles@next
Did run into the same problem, and it seems that you need the alpha version of styled to run this.
This is going to be part of material ui core soon I believe :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With