Remastered is a TypeScript-first framework. This is why we try to give you powerful utilities and types to allow the compiler know as much as it can, to help you develop software quicker and safer.
When running Remastered in development mode, and by running a production build of Remastered, the routing types will be automatically generated for you. You can also trigger it by calling remastered generate
.
This is extra handy by doing it on CI, to allow the compiler to check for broken links: 😉
npx remastered generate && npx tsc
<ParamLink route params>
The ParamLink
component allows you to link into a specific route, while inferring the route parameters and ensure you pass the correct types and names:
import { ParamLink } from "remastered";
function MyTweetLink() {
return (
<ParamLink
route="/@:userId/:tweetId"
params={{ userId: "galstar", tweetId: "1234" }}
>
Go to tweet
</ParamLink>
);
}
routePath(route, params)
The routePath
function is exactly like the ParamLink
component, but allows you to get the URL pathname itself, instead of using a React component 😃
This page was generated with Remastered v0.1.34 at
Wanna talk? Feel free to tweet at @galstar.