DEV Community

Discussion on: React Beginner Question Thread ⚛

Collapse
 
le565 profile image
le tuan anh

i'm using react and react-router to develop my webapp.But i'm facing a trouble. I've a parent component contains all things about router and children components correspond url. But the children component sometime request API before parent component. Maybe children component mounts before parent. Can you explain in details components life-cycle in react

Collapse
 
dan_abramov profile image
Dan Abramov

componentDidMount fires in children before parents.

I don't understand why it is a problem from your description.