|
|
|
|
|
by hbrn
1226 days ago
|
|
> So let's first back up and recognize that this earlier statement was flat out wrong. React does provide a systematic answer for this. Context was never a systematic answer. Even today the docs say: Apply it sparingly because it makes component reuse more difficult.
If you only want to avoid passing some props through many levels, component composition is often a simpler solution than context.
https://reactjs.org/docs/context.html#before-you-use-contextAnd IIRC older docs would be even more harsh at recommending not to use context. |
|