Loading video...

Video Failed to Load

Go Home

❌ Avoid Provider wrapping hell in React. ✅ Instead combine all your Providers using composition.

120,830 views • 2 years ago •via X (Twitter)

10 Comments

George Moller's profile picture
George Moller2 years ago

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 ↓

Stephen Burke's profile picture
Stephen Burke2 years ago

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?

Sarju's profile picture
Sarju2 years ago

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.

Farley's profile picture
Farley2 years ago

What are you closing exactly?

Paulo Barros's profile picture
Paulo Barros2 years ago

@fernandozabin @feokuma @AmorimRob

Chung Wei's profile picture
Chung Wei2 years ago

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.

احمد الشبيب's profile picture
احمد الشبيب2 years ago

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 👇

Anthony Laflamme's profile picture
Anthony Laflamme2 years ago

Clever

allen.xyz's profile picture
allen.xyz2 years ago

Does this require order to be maintained in the array?

MMILife's profile picture
MMILife2 years ago

What's the pros and cons aside from readability?

Related Videos