I'm trying to call other functions in React.createClass functions but it doesn't work for some reason, I'm getting Cannot read property 'test' of undefined
var WallFeed = React.createClass({
test: () => {
console.log('hello world');
},
componentDidMount: () => {
this.test();
},
render: () => {
return (
<div>test</div>
);
}
});
now, how can I call this.test() from componentDidMount (React's build in function) ?
thanks!