top | item 11114045

(no title)

tom_usher | 10 years 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.

discuss

order

pergomes|10 years ago

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.