Hacker News new | ask | show | jobs
by tom_usher 3769 days ago
Great work, I've been enjoying using this exact stack recently - this has definitely taught me a few things.

The main thing I'm still trying to get my head round with React/Redux/Router is where in the lifecycle to do data fetching - I noticed you're doing it in componentWillMount, when the React docs suggest componentDidMount, and I've seen others do it in various other ways with no clear indication what the 'best practice' approach is.

1 comments

I understand your thoughts and normally we follow the React docs suggestions for generic components. We place data fetching code in componentWillMount in those cases we want to win some time, but if it's not the case I would recommend to place it in componentDidMount as React docs suggests.