Skip to content

remix/route-pattern/href · Function

View Source

createHref

Summary

Generate an href from a route pattern and the supplied params.

Pathname wildcards reject . and .. segments. Generated pathnames have one leading slash; internal and trailing slashes are preserved.

Signature

function createHref<source extends string>(
  pattern: source | RoutePattern<source>,
  args: CreateHrefArgs<source>,
): string

Parameters

pattern

The parsed route pattern.

args

Path params and href options.

Returns

The generated href string.