Skip to content

Suspense

reference
1 min readUpdated

Kind: Constant

Source: src/jsx/dom/components.ts

Part of: Jsx

Definition

ts
FC<PropsWithChildren<{ fallback: any }>>

Value

ts
(({
  children,
  fallback,
}: any) => {
  const res = Fragment({ children })
  ;(res as any)[DOM_ERROR_HANDLER] = (err: any, retry: () => void) => {
    if (!(err instanceof Promise)) {
      throw err
    }
    err.finally(retry)
    return fallback
  }
  return res
}) as any

Used by

1 reference from 1 file. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

Imported by (1)

  • StreamingContextsrc/jsx/streaming.ts:30

Was this page helpful?

Download as PDF
Suspense — Hono (narrator proof)