How child components communicate with parent components? Facebook ReactJS Interview Question

Inverse data flow - Children communicate with parents by calling functions that are handed to them via props. In the ProductHunt app, when an up-vote was clicked Product didn't do any data management. It was not the owner of its state. Instead, it called a function given to it by ProductList, passing in its id. ProductList was then able to manage state accordingly.

Comments

Archive

Contact Form

Send