I cannot use material-ui components after update to material-ui@0.15.0-beta.1

后端 未结 3 1601
青春惊慌失措
青春惊慌失措 2021-02-07 01:58

I got this message in my console:

Failed Context Types: Required context muiTheme was not specified in AppBar

AppB

3条回答
  •  清酒与你
    2021-02-07 02:35

    now in the 0.15.0 you can use muiThemeProvider:

    ...
    
    import getMuiTheme from 'material-ui/styles/getMuiTheme';
    import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
    import MyAwesomeReactComponent from './MyAwesomeReactComponent';
    
    const App = () => (
     
        
     
    )
    
    ...
    

    So you do not have to provide context to childrens manualy. More info in documentation.

提交回复
热议问题