Redirect with matched parameters doesn't work
See original GitHub issueVersion
4.2.0
Test Case
https://codesandbox.io/s/p51on3mxlx
Steps to reproduce
Something like this
<Redirect from="/topics/:id" to="/topic/:id" />
Expected Behavior
Redirect from like /topics/1 to /topic/1 as it is described in official docs: https://reacttraining.com/react-router/web/api/Redirect/from-string
Actual Behavior
Ignoring matched params and redirecting from /topics/1 to /topic/:id
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Redirect with matched parameters with react-router-dom ...
A <Redirect> doesn't do any pattern compiling. You have to give it the actual URI that you want to redirect to.
Read more >Redirect with matched parameters doesn't work · Issue #5983
Redirect with matched parameters doesn't work #5983 ... Ignoring matched params and redirecting from /topics/1 to /topic/:id.
Read more >Redirect - Reach Router
Redirect. Redirects from one path to another. Use this when you want to change a URL without breaking links to the old path....
Read more >Redirect with matched parameters with react-router-dom ...
Coding example for the question Redirect with matched parameters with react-router-dom doesn't work-Reactjs.
Read more >HTTP route components (proto)
Route) The list of routes that will be matched and run, in order. The first route that matches ... RouteMatch, REQUIRED) Route matching...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I’ll be putting out a release very soon.
This isn’t released yet. But soon!