正在加载视频...

视频加载失败

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

120,830 次观看 • 2 年前 •via X (Twitter)

10 条评论

George Moller 的头像
George Moller2 年前

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 的头像
Stephen Burke2 年前

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 的头像
Sarju2 年前

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 的头像
Farley2 年前

What are you closing exactly?

Paulo Barros 的头像
Paulo Barros2 年前

@fernandozabin @feokuma @AmorimRob

Chung Wei 的头像
Chung Wei2 年前

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.

احمد الشبيب 的头像
احمد الشبيب2 年前

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 的头像
Anthony Laflamme2 年前

Clever

allen.xyz 的头像
allen.xyz2 年前

Does this require order to be maintained in the array?

MMILife 的头像
MMILife2 年前

What's the pros and cons aside from readability?

相关视频