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
For a long time I used mutate() to refresh infinite data
mutate()
const res = useSWRInfinite(key) const refresh = () => res.mutate()
But recently this caused some bugs as the behaviour of swr changed (mutate() becomes mutate(undefined))
mutate(undefined)
So I am now using:
const res = useSWRInfinite(key) const refresh = () => res.mutate(d => d)
The problem is that this technique doesn't work with revalidateFirstPage: false: mutate(d => d) does nothing when using revalidateFirstPage: false
revalidateFirstPage: false
mutate(d => d)
Is this an issue? Do I use the good way of mutating infinite data?
swr@1.0.0-beta.6
The text was updated successfully, but these errors were encountered:
By design, mutate() should work but because of the bug you have to use mutate(d => d).
mutate(d => d) does nothing when using revalidateFirstPage: false
This seems to be another bug, thanks for reporting!
Sorry, something went wrong.
No branches or pull requests
Bug report
Description / Observed Behavior
For a long time I used
mutate()
to refresh infinite dataBut recently this caused some bugs as the behaviour of swr changed (
mutate()
becomesmutate(undefined)
)So I am now using:
The problem is that this technique doesn't work with
revalidateFirstPage: false
:mutate(d => d)
does nothing when usingrevalidateFirstPage: false
Is this an issue? Do I use the good way of mutating infinite data?
Additional Context
swr@1.0.0-beta.6
The text was updated successfully, but these errors were encountered: