React Corsair - v0.0.10
    Preparing search index...

    Class PipeableSSRRouter<Context>

    Streaming router for NodeJS environment.

    Type Parameters

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

    • Instantly aborts the pending route loading for the rootController and its descendants.

      Parameters

      • Optionalreason: unknown

        The abort reason that is used for rejection of the loading promise.

      Returns void

    • Resolves with true if there were pending controllers and their state has changed after they became non-pending. Otherwise, resolves with false.

      Returns Promise<boolean>

    • Returns the array of matched routes and extracted params for a given location.

      Parameters

      • to: To

        The location to match.

      Returns RouteMatch[]

    • Looks up a route in routes that matches a location, loads its data anc component, and notifies subscribers.

      Parameters

      • to: To

        A location or a route to navigate to.

      • options: NavigateOptions = {}

        Navigate options.

      Returns void

    • Returns an inline <script> tag with source that hydrates the client with the state accumulated during SSR, or an empty string if there are no state changes since the last time nextHydrationScript was called.

      Returns string

    • Returns a script source that hydrates the client with the state accumulated during SSR, or an empty string if there are no state changes since the last time nextHydrationScript was called.

      Returns string

    • Prefetches components and data of routes matched by a location.

      The returned promise isn't rejected if component or data loading fails.

      Parameters

      • to: To

        A location or a route to prefetch.

      Returns AbortablePromise<void>

      A promise that can be aborted to discard prefetching.

    • Subscribes a listener to events published by a router.

      Parameters

      • listener: (event: RouterEvent) => void

        A listener to subscribe.

      Returns () => void

      A callback that unsubscribe a listener.

    Properties

    context: Context

    A context provided to route data loaders.

    errorComponent: undefined | ComponentType

    A component that is rendered when an error was thrown during route rendering.

    interceptedController: null | RouteController<any, any, Context> = null

    A controller of the intercepted route, or null if there's no intercepted route.

    isSSR: boolean = true

    true if the router is used in the server environment.

    loadingAppearance: undefined | LoadingAppearance

    What to render when a component or data are being loaded.

    loadingComponent: undefined | ComponentType

    A component that is rendered when a route is being loaded.

    location: null | Location = null

    The location of the latest router navigation.

    nonce: undefined | string

    A nonce string to allow hydration scripts under a script-src Content-Security-Policy.

    notFoundComponent: undefined | ComponentType

    A component that is rendered if notFound was called during route loading or rendering

    renderingDisposition: undefined | RenderingDisposition

    Where the route is rendered.

    rootController: null | RouteController<any, any, Context> = null

    A root controller rendered in a router Outlet, or null if there's no matching route or if navigation didn't occur yet.

    routes: readonly Route<any, any, any, Context>[]

    Routes that a router can render.

    stream: WritableStream

    The stream that includes both React rendering chunks and controller hydration chunks.