react-router
react-router copied to clipboard
🗺 Optional Route Segments
Allow route paths to include optional segments like /foo/:bar?.
Progress
- [x] RFC - https://github.com/remix-run/react-router/discussions/9550
- [x] Router PR - #9650
- [x] Router PR (fixes #9650) https://github.com/remix-run/react-router/pull/9684
- [x] Remix PR - https://github.com/remix-run/remix/pull/4706
- [x] Changeset - https://github.com/remix-run/remix/pull/4815
Issues/PRs
#7285 #9208 #8381 #8566
Docs
- [ ] Update docs
- [ ] Update migration guides that mention manual writing out the routes
- one in the docs
- also this discussion #8753
- Go into both and just use optional segments instead of talking about v6 not supporting them anymore
I've been working through some fixes to https://github.com/remix-run/react-router/pull/9650 to account for nested <Route>s. @brophdawg11 and I have been coordinating and the decision is to add some tests for nested <Route>s and to explode each relative path (with 1+ optional path segment) encountered in flattenRoutes.
PR: https://github.com/remix-run/react-router/pull/9684
~~Just waiting for Remix to be on RR 6.5 before merging the last PR (#4706) and closing out this roadmap item.~~
All code PRs have been merged. We just need to wait for Remix to be on RR 6.5 to update the docs.
awesome! we'll leave this issue open until we're on router 6.5 :)
All of this is going out in the next Remix/Router releases.
This is available for beta testing in Remix 1.9.0-pre.0 and React Router 6.5.0-pre.1 if anyone wants to give it a test! We're hoping to get the stable releases out later today or tomorrow.