api-platform / admin

A beautiful and fully-featured administration interface builder for hypermedia APIs
https://api-platform.com/docs/admin/
MIT License
483 stars 131 forks source link

fix(mui): createMuiTheme deprecation for createTheme #401

Closed thcolin closed 3 years ago

thcolin commented 3 years ago
Q A
Branch? stable
Tickets -
License MIT
Doc PR -

Fix MUI warning on @api-platform/admin app launch about createMuiTheme usage:

Material-UI: the createMuiTheme function was renamed to createTheme.

You should use `import { createTheme } from '@material-ui/core/styles'
alanpoulain commented 3 years ago

Shouldn't we add it in our (peer?) dependencies with the corresponding minimal version?

thcolin commented 3 years ago

I don't know the best practices for this kind of peer-dependencies, @material-ui/core is a dependency from react-admin and deprecation change was made 6 month ago on @material-ui/core@5.0.3

alanpoulain commented 3 years ago

IMO, since we are using it directly, we should add it as a dependency too. Also, is createTheme available in MUI 4? We shouldn't drop the compatibility for MUI 4.

thcolin commented 3 years ago

Yes, createTheme is available in MUI 4:

https://github.com/mui-org/material-ui/blob/v4.12.3/packages/material-ui/src/styles/createTheme.js

alanpoulain commented 3 years ago

Thanks!