I´m having some problems with react. I´m using map function at render and the function componentDidMount is being called before it finish.
Here snippet of my code
componentDidMount: function() {
console.info("didMount");
},
render: function() {
return React.createElement("div", null,
this.state.fields.map(function(field) {
console.info("field" + field);
return React.createElement("span", null, field);
}.bind(this)));
}
It being printed "didMount" before "field...". How can i solve this? It seems that map is async.
Thank´s