If you think and argue over component based programming, you'll realize that this concept advise to make code work as independent possible. Therefore, you create a components, and to make it independent you have to design it in a way that, it accepts arguments (properties, params) as input and gives you output (it may or may not hold any business logic).
Having said that, avoid coupling components together. Design it in a way that parent component maintains the state and pass props to dumb/child components.
Your question should be can two components be siblings? Well yes, if they have a parent of course... So there is your answer, they can share the state of their parent..
Not directly, no.
You have two solutions to this
this.state and would be sent down as props to A and B.If you have any questions on this, feel free to leave a reply! 😄
Sebastian
No. The component state is encapsulated so only talking over props (if you have a child parent relationship), a container component which passes the data as props to both (same hierarchy level situation) or use a „global“ state system like redux or flux.