niuware / mui-rte

Material-UI Rich Text Editor and Viewer
MIT License
432 stars 168 forks source link

mui-rte 2.0.1 not compatible with versions after @mui/material 5.0.0 and onwards? #285

Closed Karelus closed 2 years ago

Karelus commented 2 years ago

Checklist

Description

I'm using @mui/material 5.1.0, and installed newest version of mui-rte (2.0.1) Getting this error when trying to render the editor TypeError: theme.spacing is not a function. I am wrapping the editor to theme provider, but still no luck. But after changing @mui/material back to 5.0.0 it works. Is this a bug in newer versions of the package or what?

Karelus commented 2 years ago

Ok it seems that I was importing ThemeProvider incorrectly. For me at least, it worked when I switched the import from import { ThemeProvider } from '@mui/material/styles' to import { ThemeProvider } from '@mui/styles'

Docs. suggested to import it from @mui/material/styles which didn't work for me. Just curious if others have had the same problem.