batch, untrack & on in SolidJS
From the SolidJS cheat sheet ยท Reactivity Utilities ยท verified Jul 2026
batch, untrack & on
Control reactivity with batching, untracking, and explicit dependency declarations.
typescript
// Quick Reference
import { batch, untrack, on } from "solid-js";
batch(() => { setA(1); setB(2); }); // single update
const val = untrack(() => count()); // read without tracking
createEffect(on(count, (v) => console.log(v))); // explicit dep๐ก batch prevents intermediate updates โ effects and memos update once after all changes
โก untrack reads the current signal value without creating a dependency
๐ on() explicitly declares dependencies โ useful when you want to ignore some signals
๐ข Pass { defer: true } to on() to skip the initial execution of the effect
batchuntrackonreactivity