tatethurston / nextjs-routes

Type safe routing for Next.js
MIT License
580 stars 21 forks source link

Library not working with the NextJS 13 app folder #167

Closed byronthe123 closed 1 year ago

byronthe123 commented 1 year ago

I was using this library with NextJS 13 using the pages folder and it worked perfectly. However, after changing to the new app folder, the routes in /ypes/nextjs-routes.d.ts are not being generated correctly. Here's an example of the output:

export type Route =
    | StaticRoute<"/">
    | StaticRoute<"/">
    | StaticRoute<"/">;
tatethurston commented 1 year ago

This package supports the pages directory, but nextjs ships typescript support for the app directory, which you can use instead of this package:

https://nextjs.org/blog/next-13-2#statically-typed-links?

byronthe123 commented 1 year ago

Thank you for the clarification.

tatethurston commented 1 year ago

Sure thing. If you notice any room for improvement over what Nextjs provides, let me know and I’ll consider adding app support.

tatethurston commented 1 month ago

Now supported in 2.2.2