๐๏ธ Link Component
3 items
๐๏ธ Path Function
For cases like redirects or when the Link component isnโt suitable, use the $path function to get type-safe URLs.
๐๏ธ Optional Fields
Both the $path function and Link component support the optional fields searchParams, hash, and trailingSlash.
๐๏ธ Typesafe Search Params
Astro Typesafe Routes supports generation types for typesafe search params.
๐๏ธ Get Params
Use getParams to retrieve route parameters in a typesafe way. It returns a typed object based on the route's params. Internally, it simply returns Astro.params but ensures proper typing. If you pass the wrong route id, the params value and type will not match.