-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix: mutate args for useSWRInfinite hook #1947
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 656691d:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Would you mind adding a test so we won't have regression in the future?
@shuding Yes! Will do that. |
1216358
to
b6f4781
Compare
@shuding
https://swr.vercel.app/docs/mutation#optimistic-updates If not, it would be nice to add the supported options to the documentation. |
Yes, I think these should be supported by this hook too! But in the meantime it might take some time to get them implemented, so we can have separate follow up PRs. |
2d7078f
to
b6f4781
Compare
The following type also should be updated, but I think it's ok to fix it with the following PR Line 179 in a322130
|
@koba04 I can resolve these conflicts? |
…infinite-mutate-args
…infinite-mutate-args
Thanks! |
This PR fixes the bug mentioned in #1899.
As mentioned in the documentation (https://swr.vercel.app/docs/pagination#return-values), mutate function returned by the useSWRInfinite hook should work the same as the useSWR hook.