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

后端 未结 3 1610
青春惊慌失措
青春惊慌失措 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:52

    Import MuiThemeProvider and then wrap the material-ui component AppBar with MuiThemeProvider.

    import React, { Component } from 'react';
    import AppBar from 'material-ui/AppBar';
    import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
    import './App.css';
    
    class App extends Component {
    
      render() {
    
        return ( 
          
            
    ); } } export default App;

提交回复
热议问题