Loading video...
Video Failed to Load
❌ Avoid Provider wrapping hell in React. ✅ Instead combine all your Providers using composition.
120,830 views • 2 years ago •via X (Twitter)
10 Comments

I've been working professionally with React for more than 8 years and I compiled all my knowledge into 100+ infographics and 70+ video tutorials just like this one. Check them out ↓

This seems like a useless abstraction. You typically never need to touch that nest so adding all of that extra code to achieve the same result seems pointless. What am I missing?

By doing this you are increasing lines of code, complexity and bug surface area and reducing readability and plus if you are using typescript, there will be lots of extra things to handle compare to original one.

What are you closing exactly?

@fernandozabin @feokuma @AmorimRob

This makes your code even harder to read and maintain, not to mention an unnecessary loop. Just move all providers into a separate component and call it a day.

Love your tips George, but this one is not for me. Regardless of the unreadable code I had to create for our lord Typescript, but the App initial start seems to have an odd behavior now? It looks like its re-loading multiple times before it actually settles. Before and After 👇

Clever

Does this require order to be maintained in the array?

What's the pros and cons aside from readability?
