Composition vs Inheritance and Thinking in React.js

What makes React so powerful is its’ composition model and most newer developers lean towards inheritance. While inheritance is not bad, using import is more useful and less restricting. Compostion of behavior makes your file structure and files easier to read and code becomes more simple and flexible.

React supports the passing of arbitrary children into other components by nesting the JSX, meaning that components that don’t know their children beforehand. The children prop is the best case use for these components.