You’re right actually — the right way is to fetch inside componentDidMount.
Why do the React docs recommend doing AJAX in componentDidMount, not componentWillMount?
Join the Stack Overflow Community Stack Overflow is a community of 7.6 million programmers, just like you, helping each…
As for error handling, good question! I would dig into redux-thunk for more control over async actions.