Replies: 2 comments 1 reply
-
|
I guess option 3 would be the best. Really looking forward to this getting added. Started using optional routes today and now TypeScript is so very mad at me. 😄 |
Beta Was this translation helpful? Give feedback.
-
|
This is now released under @aniravi24 Second parameter is required when there is at least one required param: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
See the following release notes for the description on remix's new optional route segments feature:
https://github.com/remix-run/remix/releases/tag/remix%401.9.0
I thought it would be worth starting a discussion on what types to generate.
Using the example from the release notes:
The path
/(one)/($two)/(three).($four)matchesThe options that came to mind as to what we can generate:
Option 1: Generate each route strictly and don't allow undefined paths
Option 2: Generate just the minimum number of routes with optional params
Option 3: Generate both optional param and non-optional routes
Thoughts? I think option 1 or option 3 seem most interesting. As a user of this library, I'm not sure I would like option 2 because I'd always have to specify the optional param in my route even if I'm not using it.
Beta Was this translation helpful? Give feedback.
All reactions