3 ms·
Preact is not signals-based, it uses the React model with state and props as the basic model, but also provides Signals as a parallel model.
by sesm 2y ago
Preact is not signals-based, it uses the React model with state and props as the basic model, but also provides Signals as a parallel model.
- CharlieDigital 2y agoI guess that's like arguing a Prius Prime isn't electric because even though it has a battery and can drive all electric, it also has a gas engine. :shrug: But very clearly, Preact has the option of the exact same reactivity primitive and design as Vue, Solid, Qwik, and Svelte https://preactjs.com/guide/v10/signals/ https://preactjs.com/guide/v10/signals/ > In Preact, when a signal is passed down through a tree as props or context, we're only passing around references to the signal. The signal can be updated without re-rendering any components, since components see the signal and not its value. This lets us skip all of the expensive rendering work and jump immediately to any components in the tree that actually access the signal's .value property.
- sesm 2y agoI'll accept an analogy with a hybrid car. In this analogy, Preact would be a gas car with an additional electric engine bolted on as an afterthought.
- CharlieDigital 2y agoBut you know, the Prius Prime is a PHEV as in "plug in hybrid electric vehicle"
- sesm 2y agoOh, I see what you mean now! This sounds like a very good analogy.