Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

material-ui #360

Open
FredericHeem opened this issue Jun 25, 2016 · 3 comments
Open

material-ui #360

FredericHeem opened this issue Jun 25, 2016 · 3 comments

Comments

@FredericHeem
Copy link

It seems that material-ui react components cannot be displayed with carte-blanche:

Failed Context Types: Required context `muiTheme` was not specified in `CircularProgress`.
@w01fgang
Copy link

@FredericHeem yes you must pass context to the material-ui components.
In theory you can add MuiThemeProvider to the carte-blanche's main component App

import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
...
<div className={(!this.state.drawerVisible) ? styles.preview : styles.previewOpen}>
          <MenuButton
            onClick={this.toggleMenu}
            drawerOpen={this.state.drawerVisible}
          />
          {(this.props.children) ? (
            <MuiThemeProvider>
               this.props.children
            </MuiThemeProvider>
          ) : (
            <div className={styles.home}>
              <h2>Home</h2>
              <p>Get started by selecting a component on the left 🙌</p>
            </div>
          )}
        </div>

@nikgraf
Copy link
Member

nikgraf commented Jun 26, 2016

@w01fgang did your fork it to get this working?

I was thinking if we allow to create your own container as an options …

@w01fgang
Copy link

w01fgang commented Jun 26, 2016

@nikgraf no, I didn't fork it because I don't have much time, but I use material-ui for a long time and I know well this error.
I think passing own container is a good option.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

3 participants