News for hackers. Stuff that matters.
Re:Simple React Patterns by FLUX-YOU on Friday November 10, 2017 @08:32AM (#15669724)
Where is the typical place to put initial fetches? I've been setting empty state and then calling a method at the end of a constructor which ultimately results in a promise that calls setState with the data.

But I would never do something like that in, say, the constructor of a WPF/UWP windows app as those have "Loaded" or "Loading" events of some kind (which is parallel to componentDidMount).

Re:Simple React Patterns by ihsw2 on Friday November 10, 2017 @09:20AM (#15669996)
`componentDidMount`, which is after a React component has been rendered. This contradicts the parent commenter directly but I'm fine with that.

The React lifecycle has `componentDidMount` for doing stuff (at most once) after rendering.

Re:Simple React Patterns by always_good on Friday November 10, 2017 @11:02AM (#15670733)
I don't understand what you're saying.

Once the component mounts, then it can be unmounted. The upstream comment is talking about when you have a promise that is still running after unmount.