I\'m trying to fetch the data from the server after component has been updated but I couldn\'t manage to do that. As far as I understand componentWillUnmount
is cal
The accepted answer works, and is a valid workaround for the problem of calling asynchronous functions in the component rendering methods (getInitialState, componentWillMount, componentDidMount).
But a better practice would be to use state management helpers like Redux and Flux and a global store, this might avoid the problem of multiple setStates.