Back to search

Component communication, sibling communication, and composition vs inheritance in React

Data usually flows down from parent to child, while child-to-parent and sibling communication happen through callbacks, lifted state, or shared providers.

React Medium Theory

Component communication, sibling communication, and composition vs inheritance in React

Data usually flows down from parent to child, while child-to-parent and sibling communication happen through callbacks, lifted state, or shared providers.

  • Parent-to-child uses props
  • Child-to-parent uses callback props
  • Composition is preferred over inheritance in React

Component communication, sibling communication, and composition vs inheritance in React