Skip to content

NavLink isActive is not returning true on all paths with multiple paths on same component #6759

@kentrh

Description

@kentrh

Version

5.0.0

Test Case

https://codesandbox.io/s/react-router-1pf7h

Steps to reproduce

  1. Add <Route> with multiple paths
  2. Set something that uses the active prop like activeClassName or activeStyle on <NavLink>

Expected Behavior

Maybe I'm totally off here and misunderstood something fundamental, but in my mind it would make sense that both / and /two in the test case should be active when url is /

Actual Behavior

Only / is active when url is / when both / and /two are set ass paths for the Home component.

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