2 ms·
Since he's using the context api https://reactjs.org/docs/context.html https://reactjs.org/docs/context.html not exactly. Imagine you have a React tree with a
by bryanrasmussen 7y ago
Since he's using the context api https://reactjs.org/docs/context.html https://reactjs.org/docs/context.html not exactly.
Imagine you have a React tree with a 100 node depth. You would then need to walk all the way up those 100 nodes, but using the context api you can put in context consumer at the branches of your tree where it makes sense, so instead of walking up 100 nodes you walk up 3 nodes to input into the global context.
Hope that is a reasonable high level explanation of a thing that can be complicated without experience of it.