Closed ckastbjerg closed 3 years ago
This will enable the following use cases with the getRoute util:
getRoute
getRoute("/optional-catch-all"); getRoute({ route: "/optional-catch-all", path: "/a/b/c" }); getRoute({ route: "/catch-all", path: "/a/b/c" }) getRoute({ route: "/nested-catch-all/[dynamic]/slugs", params: { dynamic: 1 }, path: "/a/b/c", })
Or with an abstraction on top of the next/link component:
next/link
<Link to="/optional-catch-all">Optional catch all (no path)</Link> <Link to={{ route: "/optional-catch-all", path: "/a/b/c" }}> Optional catch all </Link> <Link to={{ route: "/catch-all", path: "/a/b/c" }}> Catch all </Link> <Link to={{ route: "/nested-catch-all/[dynamic]/slugs", params: { dynamic: 1 }, path: "/a/b/c", }} > Nested catch all (with params) </Link>
This will enable the following use cases with the
getRoute
util:Or with an abstraction on top of the
next/link
component: