-
Notifications
You must be signed in to change notification settings - Fork 1.3k
key has change, never revalidate #1531
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
Comments
I think this should be the correct behavior of |
@shuding I had a similar issue I want to only revalidate if the key changes but otherwise never revalidate. What combination of options should I use? |
1 similar comment
@shuding I had a similar issue I want to only revalidate if the key changes but otherwise never revalidate. What combination of options should I use? |
I have the same problem, I don't want revalidateOnMount but I need revalidateOnKeyChange. Can you add the new config revalidateOnKeyChange? More clear, I want using useSWRImmutable and can revalidateOnKeyChange to be true How can SWR meet my requirement? Thanks! I can code like below, but I really want it have officially config to achieve.
|
Reopened the issue since the following should be the correct behavior. When the key changes, useSWRImmutable should definitely refetch.
|
Is this still an active bug? |
here is the reproduce You can switch key by click each button, and see the revalidate log. It won't revalidate if key already fetched, so I want a config like I don't know this is a bug or not. |
Bug report
Description / Observed Behavior
version: 1.0.1, key has change, never revalidate
Repro Steps / Code Example
CodeSandbox
Context
#1430 (comment)
The text was updated successfully, but these errors were encountered: