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

Documentation of onErrorRetry is wrong #1123

Closed
plaa opened this issue Apr 13, 2021 · 0 comments · Fixed by vercel/swr-site#87
Closed

Documentation of onErrorRetry is wrong #1123

plaa opened this issue Apr 13, 2021 · 0 comments · Fixed by vercel/swr-site#87
Labels
documentation Improvements or additions to documentation

Comments

@plaa
Copy link

plaa commented Apr 13, 2021

Bug report

Description / Observed Behavior

The example in https://swr.vercel.app/docs/error-handling#error-retry calls revalidate with { retryCount: retryCount + 1 }. However, it seems that retryCount is automatically increased before calling onErrorRetry.

If you log retryCount in the above example, you get 1, 3, 5, 7, .... If you remove the + 1 then you get 1, 2, 3, ....

Additional Context

Tested on SWR 0.5.5.

@huozhi huozhi added the documentation Improvements or additions to documentation label Apr 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants