Skip to content

[Bug]: href for NavLink in hashrouter does not use # #9392

@codeape2

Description

@codeape2

What version of React Router are you using?

6.4.1

Steps to Reproduce

Using createHashRouter - after upgrading from 6.3 to 6.4, the href links rendered by <NavLink> (and <Link>) change:

<NavLink to="/report"> using 6.3: <a href="#/report">
<NavLink to="/report"> using 6.4: <a href="/report">

This breaks right-click -> open in new tab.

Expected Behavior

<NavLink> used within a hash router should create href="#...".

Actual Behavior

<NavLink> used within a hash router creates href without #.

This breaks right-click->open in new tab.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions