My question is very simple, I want to use the Material-ui default darkTheme in a part of my app. Here is a sample of code :
<div>
<MuiThemeProvider muiTheme={getMuiTheme(darkBaseTheme)}>
<div>
<AppBar title="I am dark" />
<MyCustomComponent label="I should be dark but I am not" />
</div>
</MuiThemeProvider>
<MuiThemeProvider muiTheme={getMuiTheme(lightBaseTheme)}>
<p>I am in the lightBaseTheme (default theme)</p>
</MuiThemeProvider>
</div>
The first part of the app must be in the dark theme (that's a left menu), the second part in the light theme (that's the app itself).
The AppBar
that is a direct child of the MuiThemeProvider
is indeed dark, however, MyCustomComponent
and its children (even when they are base Material-ui components such as RaisedButton) are not using the dark theme.
What is the simplest way to have MyCustomComponents
and all its sub-children to use the dark theme too ?