React Signals are reactive primitives for state management that update components pointwise, without full re-rendering.
Why it matters: React's default re-rendering model is coarse-grained — when state changes, the entire component (and potentially its children) re-renders. In large components or lists, this causes performance issues even when only a small piece of data changed. Signals solve this by tracking dependencies at a granular level and updating only the exact DOM nodes that depend on the changed value.
React problem: When state changes, the entire component re-renders. Even if only one element in a large list changed. Signals solution: Automatically track dependencies and update ONLY the necessary parts of DOM.
How Signals work:
signal.value inside a component, React tracks that this component depends on this signal.signal.value changes, only the components that read it are re-rendered.Example (Preact Signals):
1import { signal, computed, effect } from "@preact/signals";23const count = signal(0); // Reactive variable4const doubled = computed(() => count.value * 2); // Computed56// Automatically executes when count changes7effect(() => console.log("Count:", count.value));89// In component — only this component re-renders10function Counter() {11 return <button onClick={() => count.value++}>{count}</button>;12}
Comparison with useState:
Performance considerations:
Common pitfalls:
Libraries: @preact/signals-react, @tui-core/signals, Legend State.