npm / @preact/signals
@preact/signals
What changed in @preact/signals 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-20.
6 new APIs and options2 performance3 behavior and defaults1 tooling18 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@preact/signals 230 changes
New APIs and options 6
The fallback prop can now be a function, avoiding eager evaluation when the collection has items.
The Preact and React adapters now export the ModelFactory type.
The fallback can now be a function, enabling lazy instantiation and avoiding eager evaluation, which matters when working with signals.
Adds an optional getKey prop for stable list reconciliation, fixing incorrect DOM reuse when items are removed or reordered.
Adds a hook for using Models in React and Preact components. It lazily creates the model, preserves its instance across re-renders, and disposes it when the component unmounts.
The when property of Show can be a function, so it does not have to be transformed into a boolean computed.
Performance 2
Checks whether the debug package is enabled only once, fixing a performance regression.
The changes to useComputed were reverted, favoring performance.
Behavior and default changes 3
The <For> component now accepts readonly arrays and signals containing readonly arrays.
The when of a For component can return a plain array.
useLiveSignal now accepts plain values.
Tooling 1
Signals created internally by the Preact adapter and useLiveSignal are named so debugging tools can identify them.
Fixes and other changes 18
Prevents rerunning a useSignalEffect for a component unmounted by the same update, avoiding an effect run against an unmounted component.
Component tracking now stops before Preact reconciles the returned VNode, preventing Signals read by DOM property getters from subscribing the parent component.
The auto-memoization heuristic no longer treats useContext as hook state, allowing context consumers to keep props-based render skipping.
Signal prop updaters are disposed when an element re-renders without signal props, preventing stale signals from overwriting DOM values.
Cached <For> children now reactively receive updated render-prop indexes after removals or reorders, preserving DOM and component identity.
Prop-binding effects write applied values back into rendered props so Preact's diff baseline stays in sync when it reuses a DOM node.
Fixes infinite recursion when tools such as Storybook traverse Signal props.
Re-mounting components now preserves DOM updaters correctly.
Scheduled effects no longer hijack the execution context.
Fixes an issue where unmounted vnodes could update with signals.
The For component now has a display name, making it identifiable by name in developer tools.
The Show component now has a display name, making it identifiable by name in developer tools.
Utility component types now accept ComponentChildren/ReactNodes as children and fallbacks.
The cached and non-cached shape is now the same.
The For cache is prevented from expanding infinitely.
aria/data attributes now stick around when going back to an empty string.
For now accounts for nested reactivity.
Show now accounts for nested reactivity.