- Add the
InferRoutes
utility type - Fix
Router.push
/Router.replace
/Router.{RouteName}
params
argument type whenrouteName
is 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 }'.
};