Method Suspense
- Namespace
- Velvet
- Assembly
- Velvet.Docs.dll
Suspense(VNode?, VNode?[], string?)
Boundary that displays fallback while a descendant declares a pending async
resource via Use<T>(), until the resource resolves. A descendant behind a nested
V.Suspense() is caught by that boundary instead, so it does not raise this one's fallback.
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
fallbackVNodeVNode displayed while any descendant is suspended. Must not be null.
childrenVNode[]Child VNodes whose pending async resources trigger the boundary.
keystringKey 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.