I wish the react context api was still shitty so people would use it less
-
-
tbf react kinda invented the concept itself, so we’re in the process of discovering the best practices. I’m sure it’ll get better.
-
Nah, Lisp was there first https://wiki.c2.com/?DynamicScoping
- 3 more replies
New conversation -
-
-
The first thing to figure out is if the Theme needs to be able to change while you're looking at the app and preserving state. Some are just a reusable component that can get customized but it doesn't ever change. I.e. there's no dark/light mode or theme switcher in the UI.
-
For those case I think they should ideally be done at the bundler/compiler level. I realize a lot of that infra is not in place in a lot of set ups though. For the dark/light or theme switcher case, IMO that should be a state that changes in React which makes it a "subtree".
- 5 more replies
New conversation -
-
-
so many confused people in the replies there (including me)
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
My understanding is that Context API allows to: - avoid prop drilling - override itself (Seb: different per subtree) - notify (it's observable) This observability is what a shared singleton (== "module state"?) doesn't have. Context has it built-in.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.