Reference

@reckona/mreact-router/link

18 public exports.

Function

FunctionLinkfunction Link<Href>(props: LinkProps<Href>): ReactCompatElement function Link(sink: HtmlSink, props: LinkProps<string>): voidRenders an app-router anchor with typed `href` support and navigation runtime attributes. In JSX it returns an anchor element compatible with the mreact runtime; during server streaming it can also write directly to an `HtmlSink`. Unsafe URL attribute values are dropped during rendering.FunctionlinkPropsfunction linkProps(options: LinkOptions<string>): Record<string, string>Converts router link options into anchor attributes consumed by the client navigation runtime. Use this when rendering a custom anchor component that should still opt into mreact prefetch, scroll, reload, or transition behavior.

Interface

InterfaceAppRouteDeclarationsinterface AppRouteDeclarationsAllows applications to augment statically registered app route paths through `@reckona/mreact-router/link`.InterfaceLinkOptionsinterface LinkOptionsConfigures client navigation behavior for a router link.InterfaceLinkPropsinterface LinkPropsCombines router link options with anchor attributes and children.

Re-export

Re-exportAppRouteLinkHrefconst AppRouteLinkHref: unknownRe-exports typed route href helper types used by Link.Re-exportAppRouteLinkHrefSuffixconst AppRouteLinkHrefSuffix: unknownRe-exports typed route href helper types used by Link.Re-exportAppRouteLinkPathnameconst AppRouteLinkPathname: unknownRe-exports typed route href helper types used by Link.Re-exportAppRouteLinkSegmentconst AppRouteLinkSegment: unknownRe-exports typed route href helper types used by Link.Re-exportAppRouteLinkSegmentsconst AppRouteLinkSegments: unknownRe-exports typed route href helper types used by Link.

Type Alias

Type AliasConcreteLinkHrefGuardtype ConcreteLinkHrefGuard = [RegisteredAppRoutePath] extends [never] ? unknown : Href extends Extract<RegisteredAppRoutePath, `${string}:${string}`> ? { __mreactRoutePatternHrefError__: never } : unknownProduces a compile-time error shape when a typed Link receives an unresolved route pattern.Type AliasLinkChildtype LinkChild = ReactCompatNode | Node | TrustedLinkHtml | readonly LinkChild[]Represents children accepted by the app-router Link renderer.Type AliasLinkHreftype LinkHref = [RegisteredAppRoutePath] extends [never] ? string : AppRouteLinkHref<RegisteredAppRoutePath>Resolves the accepted `href` type for app-router links.Type AliasLinkPrefetchtype LinkPrefetch = "intent" | "viewport" | "none" | falseSelects when the app router should prefetch a linked route.Type AliasLinkScrolltype LinkScroll = "top" | "preserve"Controls scroll restoration behavior after client navigation.Type AliasLinkTransitiontype LinkTransition = "auto" | "none" | falseControls whether client navigation participates in view transitions.Type AliasRegisteredAppRoutePathtype RegisteredAppRoutePath = AppRouteDeclarations extends { path: infer Path } ? Extract<Path, `/${string}`> : neverExtracts registered route paths from `AppRouteDeclarations`.Type AliasTrustedLinkHtmltype TrustedLinkHtml = unknownWraps pre-escaped HTML that can be used as trusted link children.