We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Mutating an unmounted useSwr key previously validated will not trigger revalidation when revalidateIfStale is false.
useSwr
revalidateIfStale
false
After a mutation mutate('key') all useSwr() will be revalidate, if not mounted it will revalidate on mount even if revalidateIfStale is false
mutate('key')
useSwr()
StackBlitz StackBlitz steps
Generic steps
mutate
version 1.3.0 config
{ revalidateIfStale: false, revalidateOnFocus: false, revalidateOnReconnect: false, }
similar issue #751 pull request that resolved issue #1498
The text was updated successfully, but these errors were encountered:
Still present in 2.1.0 version
StackBlitz
Sorry, something went wrong.
mutate('/api/list', fetch('/api/add').then((res) => res.json()), { revalidate: true, populateCache: true })
This will prevent mutate to update the cache using the result of fetch('/api/add').then((res) => res.json()
fetch('/api/add').then((res) => res.json()
and setting
{ revalidateIfStale: false, revalidateOnFocus: false, revalidateOnReconnect: false }
is same as https://swr.vercel.app/docs/revalidation#disable-automatic-revalidations
So this behavior is expected.
No branches or pull requests
Bug report
Description / Observed Behavior
Mutating an unmounted
useSwr
key previously validated will not trigger revalidation whenrevalidateIfStale
isfalse
.Expected Behavior
After a mutation
mutate('key')
alluseSwr()
will be revalidate, if not mounted it will revalidate on mount even ifrevalidateIfStale
isfalse
Repro Steps / Code Example
StackBlitz
StackBlitz steps
Generic steps
useSwr
mutate
of previous keyuseSwr
Additional Context
version 1.3.0
config
similar issue #751
pull request that resolved issue #1498
The text was updated successfully, but these errors were encountered: