Gulshan Sharma
1 min readJul 5, 2017

--

Could you suggest me with an optimal solution in the following scenario :

The parent fetches data from an endpoint and passes the relevant data to the children as props. Children display the data and the user interacts with it which sends another post/update/ delete request to the API which changes the database accessed by API. At this point, the child is showing the previous data. I need a hook at the parent component to refetch the data from API again and re render it so that user can see the new data. Presently I passed a bound function as prop which fetches the data and updates the state at parent component. But I feel it’s inefficient.

--

--

Gulshan Sharma

React, Node, React Native, Electron => such JS, much wow.