SolidJS fine-grained reactivity: createSignal, createEffect and implicit batching
How SolidJS’s createSignal and createEffect track dependencies without a virtual DOM, and why implicit batching matters for forms and lists.
05 Sept 2025, 18:01 UTC

Problem: form flicker in reactive UIs
You’re building a form with a dozen interdependent fields—price, tax, discount, and total. In React, every keystroke triggers a re-render of the entire component tree, even when only one input changes. The virtual DOM diffing helps, but the cascade of updates can feel heavy as complexity grows. SolidJS takes a different path: fine-grained reactivity that tracks exactly which part of your UI depends on which signal, and only that part re-renders.
createSignal: fine-grained dependencies
A signal is a getter/setter pair returned by createSignal. When you read the signal (the getter), Solid records which reactive context is consuming the value. When you write to it (the setter or update), only consumers that depend on that specific signal are scheduled for update. This means a change to one input won’t cause unrelated parts of the UI to re-render.
import { createSignal } from 'solid-js'
const count = createSignal(0)
const increment = () => count.update(n => n + 1)
// Reading count() in JSX triggers dependency tracking;
// calling count.update() schedules just the consumers of count.createEffect: building the update graph
createEffect runs a function and automatically tracks every signal read during its first execution. This establishes a minimal dependency graph without a virtual DOM. When any tracked signal changes, the effect re-runs, and any UI that depends on its output updates accordingly. The effect itself does not render; it orchestrates updates to the parts of your UI that depend on its derived value.
import { createSignal, createEffect } from 'solid-js'
const count = createSignal(0)
const double = createEffect(() => {
return count() * 2
})
// double re-runs only when count changes, and any UI binding to double() updates precisely.Implicit batching and the JSX compiler
Solid’s JSX compiler transforms <Component/> into direct function calls, removing the diffing overhead common in other frameworks. More importantly, batch updates are implicit: multiple signal writes within a single microtask coalesce into one DOM update. This reduces layout thrashing and keeps your UI smooth even when you’re updating several interdependent values in rapid succession.
Because the compiler emits createElement calls with signal references visible in devtools, you can inspect the generated output to confirm that no virtual DOM diffing occurs.
Limitations and how to verify
- Signal getters must not be called outside of reactive contexts; doing so breaks dependency tracking and causes missed updates.
- The JSX compiler requires a build step. Runtime-only Solid setups use
createElementinstead, which has a slightly different API surface. - Over-using
createComputedfor expensive derivations can block the main thread if not carefully batched.
To verify your setup, install the solid-devtools extension. It visualizes the dependency graph and confirms that only affected components re-render. Alternatively, manually trigger a signal update and observe that component output changes without a full re-mount—this confirms fine-grained reactivity is working as intended.
Closing: a practical pattern
If you’re migrating from React or evaluating frameworks for a data-intensive UI, start by replacing one state variable with createSignal and observe which parts of your UI update. Pair it with createEffect for derived values, and trust the implicit batching to keep DOM operations minimal. The dependency graph becomes visible through solid-devtools, so you can confirm that only the intended components re-render. This pattern often reduces boilerplate and eliminates the need for useEffect or useMemo when the derived logic is purely reactive.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.