3 ms·
When people say “composition” they refer to different things. You are referring to object composition. In React, “composition” means has a very specific meanin
by danabramov 10y ago
When people say “composition” they refer to different things. You are referring to object composition.
In React, “composition” means has a very specific meaning: it’s putting components into components. It has very little to do with object composition because in React component instances almost never “talk” to each other. They don’t call methods on each other.
React component model is much closer to functional composition which doesn’t suffer from the drawbacks you describe.