I'm trying to use the mui-v5 with styled-components and typescript. However, even after I added the line to my tsconfig:
"paths": {
"@mui/styled-engine": [ "./node_modules/@mui/styled-engine-sc" ]
}
I'm getting an error:
Could not find dependency: '@emotion/styled' relative to '/node_modules/@mui/styled-engine/index.js'
when doing: import { ThemeProvider } from "@mui/material/styles";
I made a Code Sandbox to show my setup.
Does anyone know what I'm doing wrong?
You need to add @emotion/styled and @emotion/react to dependencies
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