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
in my code, when i pass one param it can success. but when i pass Multiple Arguments , it Infinite loop.
The text was updated successfully, but these errors were encountered:
SWR shallowly compares the arguments on every render, and triggers the validation if any of them has changed.
Like I said here #112 (comment), don't pass { schoolCode } as an argument because {} !== {}. It works exactly like React Hook dependencies.
{ schoolCode }
{} !== {}
You can do either:
useSWR(['...', useMemo(() => ({ schoolCode }), [schoolCode])], fetcher)
or
useSWR(['...', schoolCode], (method, schoolCode) => fetcher(method, { schoolCode }))
Sorry, something went wrong.
maybe It's better to write it in a document
thanks ~
No branches or pull requests
in my code, when i pass one param it can success.
but when i pass Multiple Arguments , it Infinite loop.
The text was updated successfully, but these errors were encountered: