tatethurston / nextjs-routes

Type safe routing for Next.js
MIT License
553 stars 20 forks source link

Library not working with the NextJS 13 app folder #167

Closed byronthe123 closed 11 months ago

byronthe123 commented 11 months 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 11 months 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 11 months ago

Thank you for the clarification.

tatethurston commented 11 months ago

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