samedi 23 décembre 2017

proptypes error when using material-ui

i just started a reactJS project and when i decided to use material-ui it statrted throwing a lot of errors:

bundle.js:12441 Warning: Failed Context Types: Calling PropTypes validators directly is not supported by the prop-types package. Use PropTypes.checkPropTypes() to call them. Read more at http://ift.tt/2pPxRx8 Check the render method of CardHeader.

my App component looks like this:

import React from 'react';
import PropTypes from 'prop-types';
import NavBar from './common/NavBar';
import Logo from './common/Logo';
import MuiThemeProvider from 'material-ui/styles/MuithemeProvider';

class App extends React.Component {
  render() {
    return (
      <MuiThemeProvider>
        <div className="container-fluid">
          <Logo />
          <NavBar />
          {this.props.children}
        </div>
      </MuiThemeProvider>
    );
  }
}

App.PropTypes = {
  children: PropTypes.object.isRequired
};

export default App;

material-ui version: 0.20.0 react version: 15.0.2




Aucun commentaire:

Enregistrer un commentaire