useTransition
Edit this pageSolid 2.0 —
useTransition has been removed in Solid 2.0. Transitions are now a built-in scheduling concept managed by the runtime. Multiple transitions can be in flight simultaneously.
Replacement
// 1.ximport { useTransition } from "solid-js"const [isPending, start] = useTransition()start(() => setSignal(newValue))
// 2.0 — just update the signalsetSignal(newValue)
// For pending state:import { isPending } from "solid-js"const pending = () => isPending(() => asyncMemo())- Use
<Loading>boundaries for initial loading UI - Use
isPending()for stale-while-revalidating indicators - Use
action()for mutations with optimistic UI
See the fetching data guide for complete patterns.