Open Xample opened 4 months ago
Hi, regarding this file:
https://github.com/kruschid/typesafe-routes/edit/master/docs/basic-features/parameter-types.md
In many examples we do have
import { createRoutes, oneOf } from "typesafe-routes"; const options = oneOf("movies", "music", "art") const routes = createRoutes({ home: ["home", options("category")] // <- wrong }); routes.render("home", {path: {category: "music"}}); // => "/home/music" routes.parseParams("home", "/home/art"); // => {category: "art"}
i.e. home: ["home", options("category")]
this won't compile, it should be
const routes = createRoutes({ home: { path: ['home', options('category')] }, });
As I found this mistake in many places (in the same file) I was wondering if this is a real error or just a kind of upcomming shorthand for the path that I missed.
Hi, regarding this file:
https://github.com/kruschid/typesafe-routes/edit/master/docs/basic-features/parameter-types.md
In many examples we do have
i.e. home: ["home", options("category")]
this won't compile, it should be
As I found this mistake in many places (in the same file) I was wondering if this is a real error or just a kind of upcomming shorthand for the path that I missed.