4 ms·
If you are posing the question, "why does Preact not make hooks behave like signals?", it very likely is to retain similarity with React where you only have hoo
by thelastbender12 4y ago
If you are posing the question, "why does Preact not make hooks behave like signals?", it very likely is to retain similarity with React where you only have hooks. For better or worse, Preact is known to most folks as an alternate implementation of React with the same API.
SolidJs shows you can get most of the functionality of hooks using signals. Who knows, if someday most Preact users converge to using signals for state management, maybe they will throw out hooks altogether. But in their current context, supporting both hooks and signals feels a reasonable choice to me.
- remram 4y agoBut the API of signals and hooks is the same... What would change if new signal thing was called useState?