Under The Hood
frontend solidjs SolidJS 1.x / 2.x

useTransition: Deferred Concurrent Updates & Pending State Flags

Last updated
Prerequisites:
SolidJS createResource
SolidJS Suspense
  • solidjs
  • useTransition
  • transitions
  • suspense
  • async
  • concurrency

Read at your depth

The practical view

`useTransition` allows you to defer coordinate state updates that trigger `<Suspense>` boundaries. `const [pending, start] = useTransition();`. When you wrap a state change in `start(() => setTab('photos'))`, Solid keeps the current view on screen instead of falling back to the `<Suspense>` loading spinner, while setting `pending()` to `true` so you can show an inline progress bar.

The same idea in other frameworks

react equivalent
React `useTransition` / `startTransition` with concurrent lane preemption.

Legacy vs modern

Immediate Suspense Fallback Flash vs useTransition Graceful Hold

Switching tabs without transition flashes an ugly full-page spinner; `useTransition` keeps the current tab visible until the new tab is ready.

before → after
Direct State Switch (Flashes Spinner)
setTab('heavyTab'); // ❌ Unmounts current tab and flashes Suspense fallback
useTransition Graceful Hold
start(() => setTab('heavyTab')); // ✅ NEW: Holds current tab visible until ready

Interview gotchas

Context

Interviewers test deep architectural comprehension across competing framework paradigms.

The mechanical answer

React implements `useTransition` via **CPU Time-Slicing across Virtual DOM Fibers**: it splits component tree rendering into interruptible 5ms chunks across priority Lanes. SolidJS has no Virtual DOM and renders synchronously; it implements `useTransition` as an **Asynchronous Suspense Coordinator**: it tracks pending `createResource` promises and delays swapping Suspense branches in the real DOM until all background fetches complete.

Trap

Do not say that SolidJS time-slices JavaScript execution on the main thread. Solid does not time-slice; it coordinates asynchronous resource boundaries.

Under The Hood — a multi-depth technical interview hub.

Third-party licenses Press ⌘ K to search.