I grab my data in my componentWillMount call of my component [actually it\'s in a mixin, but same idea]. After the ajax call returns, I attempt to setState, but I get the error
Trying this out in a simple component, the following works just fine:
getInitialState: function() {
return {
title: 'One'
};
},
componentWillMount: function() {
setTimeout(function(){
this.setState({
title: 'Two'
});
}.bind(this), 2000);
},
Can you post the exact error, and perhaps the stacktrace, so we may better see the problem you are having?