onError callback in global SWRConfig not being called #747
Answered
by
promer94
RaddishIoW
asked this question in
Q&A
-
Hi all, I have a global SWRConfig, returned by a custom hook, that I'm using to wrap SWR calls, with an onError callback defined, but the callback is not being called - it just throws the error up to React. My SWRConfig is returned thus:
Then in my component I have:
|
Beta Was this translation helpful? Give feedback.
Answered by
promer94
Nov 6, 2020
Replies: 1 comment 2 replies
-
In Suspense mode, if an error occurred, you need to use an error boundary to catch it. |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
RaddishIoW
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In Suspense mode, if an error occurred, you need to use an error boundary to catch it.
you can check the doc and example.