These docs are old and won’t be updated. Go to react.dev for the new React docs. React has a powerful composition model, and we recommend using composition instead of inheritance to reuse code between components. In this section, we will consider a few problems where developers new to React often reach for inheritance, and show how we can solve them with composition. Containment Some components do
![Composition vs Inheritance – React](https://cdn-ak-scissors.b.st-hatena.com/image/square/b2c712cc98dd4b4358911c413bad77e850529eee/height=288;version=1;width=512/https%3A%2F%2Flegacy.reactjs.org%2Flogo-og.png)