Concise shorthand for defining a typed path template.
const TodoById = route({ id: number().coerce() })`/${t => t.id}`; Copy
const TodoById = route({ id: number().coerce() })`/${t => t.id}`;
const Path = route`/some/path`;// orconst Path = route()`/some/path`; Copy
const Path = route`/some/path`;// orconst Path = route()`/some/path`;
Either a property map for typed path segments, or a TemplateStringsArray when used directly as a tagged template.
TemplateStringsArray
A ParseStringSchemaBuilder, or a tagged-template function that produces one.
ParseStringSchemaBuilder
Concise shorthand for defining a typed path template.
Example: With parameters
Example: Static path (no parameters)
Param: propsOrStrings
Either a property map for typed path segments, or a
TemplateStringsArraywhen used directly as a tagged template.Returns
A
ParseStringSchemaBuilder, or a tagged-template function that produces one.