-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Open
Description
I'm using React Router as a...
library
Reproduction
- Go to https://codesandbox.io/p/sandbox/condescending-morning-49tz97
- Click on "Nested route without hash"
- Click on "Same path+hash, different state" a few times
- Click on "Nested route with hash"
- Click on "Same path+hash, different state" a few times
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) { |