tatethurston / nextjs-routes

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

Types too wide for page path query parameter. #125

Closed janwirth closed 1 year ago

janwirth commented 1 year ago

Why is the query parameter for a page route typed as string | string[] | undefined? Shouldn't a matched route always be available and a single string?

tatethurston commented 1 year ago

Next.js collapses path parameters and search parameters into a single query object.

This library will include a matched route path parameter in the query. If you have a specific example in mind, I’m happy to provide more concrete feedback.