Since react is meant to be used as a view, your ajax requests are supposed to be placed in your model.
Else, if for some reason you need to make it in a view, the difference between componentDidMount
and componentWillMount
is that the first one is being invoked once the element is re-rendered and you have access to it via this.getDOMNode()
, and the second one is invoked once right before render()
starts.