v2.2.2-rc.4
Pre-release
Pre-release
2.2.2
-
Adds support for Next.js's
appdirectory.Linkaccepts either static routes (no url parameters) or aRouteLiteralstring, which can be generated by theroutehelper from this library:import { route } from "nextjs-routes"; <Link href={route({ pathname: "/foos/[foo]", query: { foo: "bar" }, })} > Baz </Link>;
-
Add
RouteLiteraltype. This type represents a string that confirmed to be a validated application route and can be passed toLinkoruseRouter. This is a TypeScript branded type.import { RouteLiteral } from "nextjs-routes";
-
Refine types for
usePathnameanduseParamsfrom"next/navigation"to usenextjs-routesgenerated types. -
Fix generated routes when using parallel-routes and intercepting-routes.
-
Fix
reftype forLink. Previouslyrefwas missing, now it's correctly typed.
Full Changelog: v2.2.2-rc.3...v2.2.2-rc.4