0
var comp1 = React.createClass({
render: function() {
return (
<div>
<div class="content">
<p> information here ..</p>
</div>
</div>
);
}
});
var comp2 = React.createClass({
render: function() {
return (
<div>
<div className="content">
<p>information here</p>
</div>
</div>
)
}
});
如何要求COMP1在另一个测试文件
我在文件末尾添加module.exports和
var myComponents = require('../js/components/App.js').comp1
但得到所需要的以下错误
- TypeError: Cannot read property 'exports' of undefined
仍然得到同样的错误与此设立 –
你能提供更多的信息?你如何做出口,哪里出错等等。 – Mark