3 ms·
This is exactly correct and a large driver of the problem for me. React Hooks eschew solving the problem I really care about (shared state) in favor of solving
by kansface 6y ago
This is exactly correct and a large driver of the problem for me. React Hooks eschew solving the problem I really care about (shared state) in favor of solving the problem I don't care about 99% of the time (shared life-cycle). On top of that, the API is terrible - magical extra args, stale closures over state are baked in, and using a hidden index to track call order so they can't be used in branches or loops!? I have never written a hook correctly on the first try because the behavior is too unpredictable/subtle.
- satvikpendem 6y agoMaybe you'd like the Vue version which doesn't have those problems. I'm not sure how they implement it however.