I have been writing components in React.js recently. I have never had to use methods like componentWillMount
and componentDidMount
.
rend
This is an example of an isomorphic web application that makes use of componentWillMount
: https://github.com/coodoo/react-redux-isomorphic-example
However, I'm 99% certain that it runs the code inside componentWillMount
for no reason on the server side (I think using componentDidMount
to ensure it was only run client side would have made more sense) as the code which ensures that fetch promises are fulfilled before rendering the page is in server.js not inside the individual components.
There is discussion on per-component async fetching here: https://github.com/facebook/react/issues/1739 As far as I can tell, there is not a good use case for componentWillMount
as far as isomorphism is concerned at least.