How React components talk to each other
Parent-child communication
The fundamental composition pattern in React is that a parent component will send props
to the child component.
The props can be divided into two main categories:
- data from the parent for the child to use for rendering.
- callbacks for the child to invoke when it wants to communicate with the parent.
Sibling communication
When two sibling components want to communicate between