Skip to content

<Redirect /> can't convert additional parameters. #4919

@zackyang000

Description

@zackyang000

Hi,

In react-router v3, we can use <Redirect /> like this:

  <Redirect from="profile/:userId" to="about/:userId" />

It will be covert correct:

/profile/123 -> /about/123

Unfortunately, it's not work in react-router v4. It will be get:

/profile/123 -> /about/:id  <---- params be output directly

Is there a new way to do this in v4?

version: react-router-dom 4.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions