react-router
react-router copied to clipboard
[Bug]: optional segments with dynamic segments
What version of React Router are you using?
@6.26.1
Steps to Reproduce
Expected Behavior
matchPath('/one/:mode?/two',`/onexmode/two`)
should return null
Actual Behavior
return matched
But in doc
To align with our new Open Governance model, we are now requiring that all issues have a minimal and runnable reproduction. To that end, we're doing some housekeeping in the repo to clean up existing issues that do not have a valid reproduction. This should get us down to a more manageable number of issues and allow us to be more responsive to existing and newly filed issues.
We're using a Github actions script to identify issues without a reproduction by looking for a StackBlitz, CodeSandbox, or Github link in the issue body. This won't be perfect, so if this issue has a reproduction on another platform, please comment back on here and we can re-open the issue. Similarly, if there's a reproduction buried in a comment, please move the link into the description and comment back. Please tag @brophdawg11 or @brookslybrand in your comment so we get a notification as well 🙂.
If this issue did not have a reproduction but is still valid, or if you wish to start with a fresh issue, please create a new issue with a fresh reproduction against v7 and link to this issue in the new description.
If this a feature request, please open a new Proposal Discussion in React Router, and if it gets enough community support it can be considered for implementation.
If you have any questions you can always reach out on Discord. Thanks again for providing feedback and helping us make React Router even better!