Link
Description
Component similar to A (from @solidjs/router) but with strong typing for paths and parameters.
Import
import { Link } from "dreamkit";Definition
import type { JSXElement } from "solid-js";
declare function Link(props: { href: string; params?: Record<string, any>;}): JSXElement;Examples
Basic usage
import { $route, Link, s } from "dreamkit";
export const otherRoute = $route .path("/other") .params({ value: s.string() }) .create(({ params }) => ( <> <p>{params.value}</p> <Link href="/">Go to home</Link> </> ));
export default $route.path("/").create(() => ( <> <Link href="/other" params={{ value: 1 }}> Go to other </Link> </>));