Glossary
Plain-English definitions for the terms that appear across the comparison notes. Grouped by section so you can jump to whichever framework is unfamiliar to you.
Visual reference
Three pictures the rest of this page leans on. Pre-rendered SVGs
(mmdc --scale 8), so they stay crisp at any zoom and add
no runtime JS to the page.
ProductList components manage by hand in React and Vue.
Svelte collapses the same diagram to {#await} in the template
— see /compare/product-list.
General reactivity
- closure
- A function that "remembers" the variables in scope where it was defined. In framework code, the cleanup function returned by an effect is a closure over the setup variables (timer ids, controllers, etc.).
- mount / unmount
- Mount = the component's DOM is added to the page. Unmount = it's removed. Most setup and teardown work hangs off these moments.
- cleanup
- Code that runs on unmount (or before re-running an effect) to undo what setup did — clear intervals, abort fetches, remove listeners. Skipping it leaks memory and creates "zombie" callbacks that fire after the component is gone.
- subscribe / subscription
- Telling a reactive source ("call me when you change") and receiving updates. The framework adapter usually handles unsubscribing on unmount so you don't have to.
- store
- A piece of state that lives outside any one component, so multiple components can read and write the same value. Nanostores, Pinia, Redux, Zustand all use this term. Local state (useState/ref/$state) is not usually called a store.
- controlled input
- A form input whose displayed value is driven entirely by your state, not by the DOM. React's standard pattern:
<input value={x} onChange={e => setX(e.target.value)} />. Vue and Svelte usually handle this implicitly via v-model / bind:value. - dependency tracking (auto vs manual)
- For a derived value or an effect, "deps" are the reactive things it reads. React makes you list them explicitly (dependency array); Vue and Svelte 5 detect them automatically by recording reactive reads at runtime.
React
- JSX
- React's HTML-in-JavaScript syntax. Compiled to function calls. Looks like HTML but follows JS semantics —
classisclassName, event handlers areonClicknotonclick. - useState
- Hook for local component state.
const [x, setX] = useState(initial). CallingsetXschedules a re-render with the new value. - useEffect
- Hook for side effects (fetches, subscriptions, timers). Runs after render. Takes a function and a dependency array; the previous effect's cleanup return runs before each re-run and on unmount.
- useMemo
- Hook for memoizing a derived value. Only recomputes when its dep array changes. Equivalent to Vue's computed or Svelte's $derived, but with manual deps.
- useRef
- Hook for a "ref object" — a stable mutable container with a
.currentfield. Most often holds a DOM element (passed via therefJSX prop) or any value that should survive renders without triggering them. - dependency array
- The second argument to useEffect / useMemo / useCallback. Lists the values the hook reads. React re-runs the hook only when something in the array changes (using
Object.is).[]means "run only once after mount". - cleanup return
- A function returned by useEffect that React calls before the next effect run and on unmount. The standard place for
clearInterval,unsubscribe,controller.abort, etc.
Vue
- ref (Composition API)
- Vue's wrapper for a single reactive value.
const x = ref(0). Read or write via.valuein script; templates auto-unwrap so{{ x }}just works. Different concept from a "DOM ref" (which is also called ref but bound by template name). - computed
- Vue's auto-tracked derived value.
const sum = computed(() => a.value + b.value). Recomputes lazily when read; tracks reactive reads inside automatically — no dep list to maintain. - writable computed
- A computed with both
getandset.computed({ get, set }). Lets v-model bind to a derived value (e.g. one backed by a store) by giving it a writable surface. - onMounted / onUnmounted
- Vue's lifecycle hooks. Two separate functions for setup and teardown — Vue doesn't pair them via a return value the way React's useEffect does.
- v-model
- Vue's two-way binding directive.
v-model="x"on a text input is sugar for:value="x"+@input="x = $event.target.value". Other components define their own contract; for<input>it just works. - v-model modifiers
- Append
.modifierto v-model..lazyswitches the listener frominputtochange(commits on blur)..numbercasts the input string to a Number..trimtrims whitespace. - defineProps
- Compile-macro inside
<script setup>for declaring a component's props. Takes a TS generic for typing:defineProps<{ product: Product }>(). - <script setup>
- The terse, modern Vue Single-File-Component syntax where the top-level script body IS the component setup. Cleaner than the older
setup() { ... return { ... } }form. - Composition API
- The function-based Vue 3 API (refs, computed, watchers, lifecycle hooks). Contrast with the Options API where state lives under
data(), methods undermethods, etc. This project uses Composition API throughout.
Svelte 5
- rune
- A
$-prefixed function-like primitive in Svelte 5 ($state, $derived, $effect, $props). Signals to the compiler that the next thing is reactive. Replaces several Svelte 4 conventions (top-levellet,$:reactive statements,export let). - $state
- A reactive value.
let count = $state(0). Read and write as a normal variable; the compiler wires up reactivity. - $derived
- A reactive computed value.
const doubled = $derived(count * 2). Auto-tracks reactive reads in the expression — no deps. Use$derived.by(() => { ... })when the derivation needs multiple statements. - $effect
- A reactive side effect.
$effect(() => { ... return cleanup }). Re-runs when its tracked reads change; the returned function is the cleanup. Same shape as React's useEffect, no manual deps. - $props
- The runes way to declare component props.
let { product } = $props()with a TS annotation on the destructure. Replaces Svelte 4'sexport let. - bind:value
- Svelte's two-way binding on an input.
<input bind:value={x} />. Updatesxon every input event. Svelte 5 also supports function-bindingbind:value={() => x, (v) => x = v}for non-writable backing values. - bind:this
- Captures the DOM element into a variable.
<div bind:this={el}></div>thenel?.scrollBy(...). Svelte's equivalent of React's useRef + ref prop, with no.currentindirection.
nanostores
- atom
- The basic nanostores primitive — a single value with
.get(),.set(), and.subscribe(). Created withatom(initial). Framework-agnostic; the framework adapter handles re-rendering. - computed (nanostores)
- A read-only store derived from one or more other stores.
computed(cart, $cart => sum). Notification only fires when the derived value actually changes — saves consumers from re-rendering on no-op updates. - persistentAtom
- An atom backed by
localStorage(from@nanostores/persistent). Same API asatom, plus a key string and encode/decode functions. Survives full page navigations and reloads. - useStore (adapter)
- The hook-shaped function that subscribes a component to a nanostore and returns its current value.
@nanostores/reactreturns the value directly;@nanostores/vuereturns a Vue ref. Svelte doesn't need an adapter — it uses $store syntax directly.