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
Back to the full SolidJS cheat sheet