Skip to content
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

How to revalidate with multiple arguments? #363

Closed
iammarkps opened this issue Apr 30, 2020 · 2 comments
Closed

How to revalidate with multiple arguments? #363

iammarkps opened this issue Apr 30, 2020 · 2 comments

Comments

@iammarkps
Copy link

https://github.com/zeit/swr#multiple-arguments and mutate()

@sergiodxa
Copy link
Contributor

You can pass multiple arguments to mutate, if you have

useSWR(["/api/users", 1], fetcher);

You can do

mutate(["/api/users", 1]);

@marsonmao
Copy link

marsonmao commented Jun 2, 2021

Any possible reason that mutate(["/api/users", 1]); is not triggering fetcher?
I'm doing the same setup, but fetcher is not fired.

I can only succesfully fire fethcer if my key stays with pure string like useSWR("/api/users", fetcher); + mutate ("/api/users").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants