4 ms·
Agreed. I would not use local state apart from fine-grained performance optimizations or temporary, always-can-be-thrown-away state specific to the component i
by raspasov 6y ago
Agreed.
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.