4 ms·
For me, the primary advantage has been the ecosystem. Reagent and re-frame have been awesome since Day 1, even as react has tried to play catch-up with hooks e
by divs1210 6y ago
For me, the primary advantage has been the ecosystem.
Reagent and re-frame have been awesome since Day 1, even as react has tried to play catch-up with hooks etc.
- napsterbr 6y agoVery interesting take from re-frame's author regarding React Hooks (and why it ultimately doesn't matter that hook-based components are not very popular on CLJS): https://github.com/day8/re-frame/issues/590#issuecomment-624485714 https://github.com/day8/re-frame/issues/590#issuecomment-624...
- fiddlerwoaroof 6y agoI’ve been writing a lot of react over the past several years (JS/TS), and I strongly agree with this take: hooks, especially hooks like useState really are an attractive nuisance that, by making it easy to have local state in components, end up spreading business logic all over the view layer and coupling all the wrong things together.
- raspasov 6y agoAgreed. I would not use local state apart from fine-grained performance optimizations or temporary, always-can-be-thrown-away state specific to the component itself. Example: email field input before passing validation.
- fiddlerwoaroof 6y agoI’ve had the experience, though, that “temporary” state often becomes a feature requirement. Like, you have a field to search your dataset by email address and, next iteration, the product manager wants autocomplete based on partial input.
- raspasov 6y agoThe autocomplete results can come from the global app state. There’s no rules written in stone about what should be in local state. My default is “as little as possible”.
- fiddlerwoaroof 6y agoMy point is that I’ve found that there is very little local state that doesn’t eventually benefit from being merged into the global state management store.
- raspasov 6y agoFair enough.