Samuel
Bluesky’s social-app doesn’t use any global state manager (redux/zustand/jotai/mobx etc). Why is that? 🧵 an elaboration on this post:
Samuel@samuel.fm· 11 Aug 2025
the problem I have is that it changes global state from a last resort to a first resort. thus the lowest effort solution always turns into a nightmare mess instead of being isolated and composable
5 12 83
Samuel
What we do use: - plain old React context - @tanstack.com query Having used React context at scale… I have to say the react team was cooking once again. Yet another case of weird ergonomics pushing you to work in a good way. Hoisting state to context being a bit of a PITA is a feature, not a bug!
1 20
Samuel
Adding more and more to an enormous app means by and large, stuff gets implemented in the lowest friction way. This is where composition shines. You want state to be as local as humanly possible, so it doesn’t get everywhere.
1 14
Samuel
Global state managers on the other hand have the opposite effect. The lowest friction path becomes making your stuff global. This does not scale well at all, and becomes increasingly incomprehensible.
1 15
Samuel
The key with using Context correctly is to only put one thing in them at a time. Got two things? Use two contexts. The danger zone is when you start putting large bundles of stuff in there, like you would a global state manager. This is obviously gonna make your whole app rerender.
2 16
Samuel
@samuel.fm
it’s true. I don’t really have an answer for that beyond “dont do that” maybe solvable via lint rule?
1
Alvar Lagerlöf
Lint rules that apply some of the time are kinda hard. Warnings are largely non-effective, and an error that semi-regurarly has to be surpressed isn't great. Unless it can be defined clearly ofc.
1 1
Alvar Lagerlöf
Just trying to be the devil's advocate, because I feel like "don't do that" isn't a good PR reject comment. Then I've gotta come with an alternate approach, and "split it into one context for each little thing" could easily cause a mess. But maybe that's a skill issue?
1 1
Samuel
totally agree. I don’t know if a lint rule here would be helpful or even possible