I am in situation that I need to use state from one component as a dependency value in another's componet useEffect hook. Easy illustration of this situation is in attached image.
I know that I can pass state from first component up to the parent component, in this case the App component, and then the state from parent component (App) pass down to the second component as a prop. But is there any better solution?
Thank you for your help.