createSignal in SolidJS
From the SolidJS cheat sheet ยท Signals ยท verified Jul 2026
createSignal
Create a reactive signal that returns a getter function and a setter function.
typescript
// Quick Reference
import { createSignal } from "solid-js";
const [count, setCount] = createSignal(0);
console.log(count()); // 0
setCount(5); // set directly
setCount(prev => prev + 1); // functional update๐ก Signals return getter functions โ always call them with () to read the value
โก Setter accepts a direct value or a callback receiving the previous value
๐ Pass { equals: false } to always notify subscribers even if value is unchanged
๐ข Signals are the foundation of all reactivity in SolidJS
signalsstatereactivity