Vertz reactivity is compiler-driven. You write plainDocumentation Index
Fetch the complete documentation index at: https://docs.vertz.dev/llms.txt
Use this file to discover all available pages before exploring further.
let and const — the compiler makes them reactive. There are no hooks, no dependency arrays, and no special imports for component state.
State with let
Declare mutable state with let. The compiler transforms it into a reactive value that updates the DOM when it changes.
count changes, only the text node updates — no re-render of the entire component.
Derived values with const
Derive values with const expressions. The compiler tracks their dependencies and recomputes them when needed.
statusFilter changes, filtered and summary recompute, and only the affected DOM nodes update.
What the compiler does
The compiler transforms your code at build time. You never see or interact with the output — this is purely an implementation detail:| You write | Compiler handles |
|---|---|
let count = 0 | Reactive state that tracks reads and notifies on write |
const doubled = count * 2 | Lazy derived value that recomputes when dependencies change |
<span>{count}</span> | Fine-grained DOM binding that updates only the text node |
<div className={isActive ? 'on' : 'off'}> | Reactive attribute binding |
Rules
- Use
letfor values that change. Useconstfor values derived from other values. - Mutations in event handlers (
onClick,onInput, etc.) trigger updates automatically. - You don’t need to import anything for component-level reactivity.
Low-level APIs
batch()
Group multiple state changes into a single update flush. Useful in async callbacks or store logic where multiple values change at once.Signature
batch() calls are supported — only the outermost batch triggers the flush.