-
With SvelteKit, I'm trying to define the following routes :
I wrote the following routes:
I'm able to get the following routes to work : ✅ The following route doesn't work: ❌ And the following route works but shouldn't : ❌ What I'm doing wrong ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This should work:
I checked all use cases, these worked: and this one didn't: You'll have two different pages (one with tags, one without - the user is optional in both), but I doubt it's possible otherwise. AFAIK you can't e.g. express that either both or none of [tag] and [xtag] have to be present. The trick with the routing groups above solves it. |
Beta Was this translation helpful? Give feedback.
This should work:
I checked all use cases, these worked:
/
/@user
/tag/foo
/@user/tag/foo
and this one didn't:
/tag
You'll have two different pages (one with tags, one without - the user is optional in both), but I doubt it's possible otherwise. AFAIK you can't e.g. express that either both or none of [tag] and [xtag] have to be present. The trick with the routing groups above solves it.