问题 -
var React= require('react')
var SomeComponent= require('./utils/SomeComponent')
var Wrapper= React.createClass({
render: function(){
return <SomeComponent/>
}
})
//utils/SomeComponent.js:
var React= require('react')
module.exports= React.createClass({
//..
})
throws- Error: Invariant Violation: Wrapper.render(): A valid ReactComponent must be returned. You may have returned undefined, an array or some other invalid object.
在一个文件中使用时没有错误
(顺便说一句
var React= require('react')
抛出ReferenceError: document is not defined
global.document= window.document
global.navigator= window.navigator
也许它有关系?)