I've got a React app of the form:
<App>
<ParentComponent>
<FormComponent>
<AnotherComponent>
</ParentComponent>
</App>
I want to be able to update some state values of <FormComponent>
by clicking on elements in <AnotherComponent>
.
I don't want to place them inside each other, but keep them side-by-side. I don't want to lift up <FormComponent>
state as it's nicely encapsulated.
What's the best way to achieve this? Can I do it with just react or do I need RxJS/something else?