Javascript – React useEffect hook is not behaving correctly
I am trying to update my child component based on parent state and similarly I am trying to update the parent state by clicking on a button in child component. Both is fine but while clicking on a button in…