In react, the componentDidMount()
method of child components is invoked before that of parent components, as shown here and here.
However, this is not the case if the child's componentDidMount()
contains asynchronous code (e.g. Fetch API).
How do I run the parent's componentDidMount()
only after the child's asynchronous componentDidMount
is resolved ?