0

I have used AppBar in my React component using below mentioned code and it's throwing error like

Invariant Violation: AppBar.render(): A valid ReactComponent must be returned.

var React=require('react');
var DocumentTitle=require('react-document-title');
var Masterpage=require('./pages/Masterpage');
var App=React.createClass({

 render:function()
 {
   return(
     <DocumentTitle title='Application Tracking System'>
     <div className='App'>
        <Masterpage />
        <hr />
        {this.props.children}
      </div>
     </DocumentTitle>
   );
 }

});
module.exports=App;

and Masterpage.js contain

var React=require('react');
var AppBar =  require('material-ui/lib/app-bar');
var Masterpage=React.createClass({
  render:function()
  {
    return(
      <div>
        <AppBar  title="Application Tracking System" iconClassNameRight="muidocs-icon-navigation-expand-more" />
      </div>
    );
  }
});
module.exports=Masterpage;
4

1 回答 1

0

我找到了答案,这是因为 react 0.13.3 版本它抛出了一个错误我已经更新了 react 0.14.3 然后它工作正常。

于 2015-12-22T11:07:35.713 回答