ckastbjerg / next-type-safe-routes

Never should your users experience broken links again!
MIT License
70 stars 5 forks source link

Optional catch all routes [[...category]] route ? #12

Closed revskill10 closed 3 years ago

revskill10 commented 3 years ago

Hi, thanks for great library.

I have one issue about wildcard route, like /store/[store]/[[...category]] , i see it generates as route /store/[store]/[[ only.

Could you please check this use case ?

ckastbjerg commented 3 years ago

Hi Truong!

Glad you like it :) And thanks for submitting this issue.

I didn't think about that use case, no. I will have a look at supporting it very soon.

/Christian

ckastbjerg commented 3 years ago

@revskill10 after a bit of thinking, I feel like I found a decent solution for this use case :) If you have time, could you please let me know if this interface makes sense to you: https://github.com/ckastbjerg/next-type-safe-routes/pull/13?

ckastbjerg commented 3 years ago

I've released the changes as I didn't want to keep the PR open too long. If this doesn't solve your issue, let me know. And I'll have another look at it :)

revskill10 commented 3 years ago

@ckastbjerg Huge thanks. I'll try out and post issues if i've got any !

revskill10 commented 3 years ago

For further investigation, if you have a look at i18n routing, it would be awesome 👯‍♂️