Export ThemeProviderProps in @material-ui/core/styles #20380
Labels
new feature
New feature or request
package: material-ui
Specific to @mui/material
ready to take
Help wanted. Guidance available. There is a high chance the change will be accepted
typescript
Summary 💡
ThemeProvider
is currently being exported in @material-ui/core/styles howeverThemeProviderProps
is NOT also exported here.If you need to import
ThemeProviderProps
into your project then you have to import it from @material-ui/styles instead.This means having to add
@material-ui/styles
as a dependency in your project (otherwise you will have extraneous dependencies, which is not a good practice) just to accessThemeProviderProps
, which wouldn't be necessary if it were simply exported in@material-ui/core/styles
.It also has the potential to cause issues if
ThemeProvider
andThemeProviderProps
are modified in the future and a user upgrades@material-ui/core
to the new version but doesn't also update@material-ui/styles
.Examples 🌈
Here's an example where the user is creating an
AppProvider
component to wrap the entire app. It includes react-redux's state provider and material-ui's theme provider.Current implementation
Better implementation
Motivation 🔦
ThemeProviderProps
andThemeProvider
The text was updated successfully, but these errors were encountered: