Tutorial by Examples

That the easiest case actually, very natural in the React world and the chances are - you are already using it. You can pass props down to child components. In this example message is the prop that we pass down to the child component, the name message is chosen arbitrarily, you can name it anything...
Sending data back to the parent, to do this we simply pass a function as a prop from the parent component to the child component, and the child component calls that function. In this example, we will change the Parent state by passing a function to the Child component and invoking that function ins...
The only way if your components does not have a parent-child relationship (or are related but too further such as a grand grand grand son) is to have some kind of a signal that one component subscribes to, and the other writes into. Those are the 2 basic operations of any event system: subscribe/li...

Page 1 of 1