Skip to content

Switch "location" prop in v6 #7117

@Motoxpro

Description

@Motoxpro

Hey guys!

Amazing work on v6. Just spent the last few hours toying around and converting a few things. Made so many things so much easier!

Two things as I was messing around and looking through the code:

  1. The component's "to" prop seems different? Instead passing an object like this
    props={pathname: '/home', state: {cool: true}} <Link to={props}>Link</Link>
    I have to do this:
    props={to: '/home', state: {cool: true}} <Link {...props}>Link</Link>

  2. It seems like the "location" prop from the Switch component is gone with Routes. If so, how would I implement a pattern like this?
    https://reacttraining.com/react-router/web/example/modal-gallery

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