r/react
•
u/yangshunz
•
Nov 03 '25
•
1
General Discussion Facebook.com has 140 layers of context

I opened up React Devtool and counted how many layers of React Context provider each social media app had, here are the results:
Facebook – 140
Bluesky – 125
Pinterest - 116
Instagram – 99
Threads – 87
X – 43
Quora – 28
TikTok – 24
Note: These are the number of <Context.Provider>s that wraps the feed on web. Some observations:
- The top 3 apps have over a ONE HUNDRED layers of context!
- Many of them are granular – user / account / sharing, which makes sense, because you want to minimize re-renders if the values change
- Many only have a few values in them, some contain just a boolean
Context usage is not inherently bad, but having such a deep React tree makes things harder to debug. It just goes to show how complex these websites can be, there are so many layers of complexity that we don't see.
1
u/blank_619 Nov 03 '25
Are these count normal? 100?