T
TanStack3y ago
ambitious-aqua

When does onError callback fire?

For react-query, when does the onError callback fire? On every single error? Or on the final error. For example, if we use retries on a query or mutation, and it fails twice but on the third one succeeds, does onError run twice? Or only on the final settlement of the error. Thanks!
1 Reply
afraid-scarlet
afraid-scarlet3y ago
retries are internal. The query stays in loading state. When it goes to error state after all retries, that's when onError is called

Did you find this page helpful?