Skip to content

@continuum-js/router


@continuum-js/router / lazy

Function: lazy() ​

lazy(loader, opts?): Component

Defined in: index.ts:156

Code-split page: loader MUST be a thunk with a literal dynamic import — lazy(() => import("./Page")) — so the bundler emits a separate chunk. The loader runs on first visit; the module is cached forever after. Loading shows fallback, a failed chunk shows error.

Parameters ​

loader ​

() => Promise<Component | { default: Component; }>

opts? ​

error? ​

(e) => Child

fallback? ​

() => Child

Returns ​

Component