Skip to content

Loaders not reevaluated when navigating to a route with the same path+hash but different state #12571

@pekala

Description

@pekala

I'm using React Router as a...

library

Reproduction

System Info

Codesandbox

Used Package Manager

npm

Expected Behavior

I'd expect the loaders to re-run if the link with a different URL state is clicked, as they have shouldRevalidate returning true.

Actual Behavior

On links without hash, the loaders revalidate as expected. However, when hashes are present, the loaders stay stale. We're hitting the short circuit in startNavigation due to this branch in isHashChangeOnly. My suggestion would be to check if state was not changed in

if (a.pathname !== b.pathname || a.search !== b.search) {
and if it was, not short circuit.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions