Skip to main content
Version: Next

Interface: Route

A URL path mapped to a Page.

Create one with the route constructor.

See Routing for path patterns (dynamic segments, optional segments, splats).

Extends

  • BasePart<"route">

Properties

kind

kind: "route"

The internal Wasp type of this part. Used by the compiler. You should not set this field directly, instead use the dedicated constructors for each part type.

Inherited from

BasePart.kind


lazy?

optional lazy?: boolean

Lazy-load the page's component.

Set to false to include the page in the initial client bundle, which avoids the brief loading delay on first navigation at the cost of a larger initial download.

Default

true

name

name: string

Unique route name.


page

page: Page

Page rendered when this route matches.


path

path: string

URL path. Supports React Router patterns like /tasks/:id, /photo/:id/edit?, and /files/*.


prerender?

optional prerender?: boolean

If true, Wasp renders this page to static HTML at build time. Useful for SEO and AI crawlers.

Only works on static paths and cannot be combined with Page.authRequired. See Prerendering.

Default

false