4 ms·
what makes useState different than signals?!
by merb 3y ago
what makes useState different than signals?!
- veidelis 3y agoExplicit vs implicit dependencies (useEffect vs Signal.Computed/effect) and the fact that signals in contrast to useState can be used outside of react context which I assume is a good thing. I personally mostly prefer more explicit handling of "observable values" where function signatures show which signals/observables are used inside them.
- Offler 3y agoSignals are fine grained reactivity. React is coarse grained reactivity. Legend-state adds signals to React and I'd recommend it over Redux/zustand which we used to use.
- eyelidlessness 3y agoThey’re very similar, and you can definitely squint right to see them as fundamentally the same concept… if while squinting you also see a React component itself as a reactive effect. Which is all technically correct (the best kind), but generally not what people mean when they’re talking about signals in practical terms.