2.1.0
- Add the
InferRoutesutility type - Fix
Router.push/Router.replace/Router.{RouteName}paramsargument type whenrouteNameis an union:
const Router = createRouter({
One: "/:one",
Two: "/:one/:two",
});
const fn = (name: "One" | "Two") => {
// previously, '{ one: string }' was valid, as it fulfilled the "One" route params type
Router.push(name, { one: "1" }); // ❌ not assignable to type '{ one: string; two: string }'.
};