Table of Contents

Method Suspense

Namespace
Velvet
Assembly
Velvet.Docs.dll

Suspense(VNode?, VNode?[], string?)

Boundary that displays fallback while any descendant declares a pending async resource via Use<T>(), until the resource resolves. On error, the failure is propagated to the nearest Error Boundary (a component that overrides RenderFallback).

public static SuspenseNode Suspense(VNode? fallback, VNode?[] children, string? key = null)

Parameters

fallback VNode

VNode displayed while any descendant is suspended. Must not be null.

children VNode[]

Child VNodes whose pending async resources trigger the boundary.

key string

Key used to disambiguate siblings at the same position.

Returns

SuspenseNode

The created SuspenseNode.

Remarks

Sibling V.Suspense() boundaries placed in the same component's Render() are tracked independently: each is keyed by its own scoped position, so one boundary showing its fallback while a descendant is pending does not force its siblings into fallback. When the parent re-renders, every boundary re-evaluates only its own pending state. Splitting children into separate components is not required to get per-boundary fallbacks.