Table of Contents

Class RouteDefinition

Namespace
Velvet
Assembly
Velvet.Docs.dll

A directly constructed route that combines RedirectTo and Guard throws System.InvalidOperationException when its redirect configuration is evaluated during navigation.

public sealed class RouteDefinition
Inheritance
object
RouteDefinition

Properties

Action

Called for a submission whose method is not get, when this is the route the submission targets: React Router's route action. Its result is read via UseActionData.

CaseSensitive

Whether this route's literal path segments match case-sensitively. Defaults to false (case-insensitive). Set true for a case-sensitive route.

Children

Nested child routes rendered into this route's Outlet.

Element

Function-type component to mount when this route matches. Pass a ComponentNode built via V.Component().

ErrorElement

Component shown when the Loader or the Action fails.

Guard

Returning null continues navigation; returning a path redirects. Runs after the Blocker and matching, and before the Action and Loaders.

Handle

Application data this route carries for Hooks.UseMatches to surface with its match; never read by the router itself.

Id

Identifies this route among the matches: the key of its loader data, its action data and its error, and what Hooks.UseRouteLoaderData takes. When null the route takes its position in the tree, the indexes from the top-level array down joined by - ("0", "0-1"). Two routes of one tree sharing an id make the tree throw.

Loader

Async data loader run when this route matches; its result is read via UseLoaderData. See LoaderMode.

LoaderMode

How Loader is sequenced relative to the navigation commit. Defaults to Await.

Path

Route pattern matched against the URL, e.g. "users/:id" ("/" for the root, "" for an index route). Supports :param, optional :param?, and splat *.

RedirectTo

Static redirect target without parameter interpolation. Use Guard to derive a target from matched parameters.

ScopeId

Identifier for the per-route DI scope created via IRouteScopeFactory; null for no scope.