我试图打电话等功能于React.createClass功能,但它并不适用于某些原因,我越来越Cannot read property 'test' of undefined
调用等功能于React.createClass
var WallFeed = React.createClass({
test:() => {
console.log('hello world');
},
componentDidMount:() => {
this.test();
},
render:() => {
return (
<div>test</div>
);
}
});
现在,我怎么能从componentDidMount(React的内置函数)调用this.test()?
谢谢!
你为什么不使用如说是消除对React.createClass支持发展反应的反应社会ES6类? –