-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
useFetcher: fetcher.load doesn't revalidate when search params change #5090
Comments
Thanks @dT-Nick - I'm taking a look at this now. I think this is a bug but confirming internally. Fetchers have slightly different |
Great thanks! Perhaps this could go hand in hand with #5091. I know within a resource routes loader function you can access the referrer (the current URL a user is actually on) from the headers. So I'm hoping you might be able to access that (and the next referrer URL, similar to shouldRevalidate's |
Commented over there but yeah I think that's just a bug |
This should be fixed in Remix 1.12.0 which should be deployed in the next hour or two |
Released in 1.12.0 |
What version of Remix are you using?
1.10.0
Steps to Reproduce
CodeSandbox URL
Click the button
Change query string
. That submits a form that revalidates the index.tsx loader but doesn't revalidate fetcher.load. If you click the buttonRun 'index.tsx' action
, it works as expected, and revalidates both.The fetcher runs a resource route's loader - with the intent of using
shouldRevalidate
to manage whether it actually revalidates or not.Expected Behavior
I would expect a change in search params to revalidate all 'active' instances of fetcher.load by default (as per 1.10.0 updates, where fetcher.load revalidates).
Actual Behavior
Changing the search params doesn't seem to revalidate fetcher.load in this instance. I understand I could change the URL in
fetcher.load
to include the search params, but then theshouldRevalidate
function in the resource route isn't run, and I'd have to stick anyshouldRevalidate
logic into the useEffect.The text was updated successfully, but these errors were encountered: