Can't resolve '@material-ui/styles/styled' in '@material-ui\core\Box'

Viewed 7397

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.

1 Answers

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 :)

Related