oedotme / generouted

Generated file-based routes for Vite
https://stackblitz.com/github.com/oedotme/generouted/tree/main/explorer
MIT License
1.02k stars 47 forks source link

Route problem #130

Closed zeeeeby closed 11 months ago

zeeeeby commented 11 months ago

Hello, I have this directory tree

image

i expect, that path /pub/dashboard matches file [...all].tsx, but it dont match neither /pub/:id/dashboard nor /pub/* I didnt understand why. Can you please help?

oedotme commented 10 months ago

Glad to see it was solved.

Wanted to highlight that in your example, you could use optional segment to match the two urls you've mentioned without using [...all].tsx as a wildcard route.

Having src/pages/pub/-[id]/dashboard.tsx instead, would resolve to /pub/:id?/dashboard which matches both /pub/:id/dashboard and /pub/dashboard.

Hope that helps!