Fang Jin
May 3, 2021

--

I don't really think that "context" and "composition" are the same thing. They are designed for different purpose. And IMHO, i don't think you can ever use "composition" without `react.cloneElement` because there're always `props` you'd like each `grandChild` to be different. Otherwise what's the point of composition.

In my opinion, this article is very confusing, it tries to blend two entirely different concept into something which the author think sharing similarities.

Please study "composition" and "context" in different stream. They are both very very powerful, but just not similar powerful at all.

--

--

Fang Jin
Fang Jin

Written by Fang Jin

Front-end Engineer, book author of “Designing React Hooks the Right Way” and "Think in Recursion"

Responses (2)