Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
pekala opened this issue Dec 17, 2024 · 0 comments
Labels

Comments

@pekala
Copy link

pekala commented Dec 17, 2024

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.

@pekala pekala added the bug label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant