Replies: 1 comment
-
error defaults to unknown, because anything can be thrown in js. See: https://tkdodo.eu/blog/react-query-and-type-script#what-about-error but passing the generics to useMutation should also work. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
As the title says. Any idea how to type the error returned from axios?
With the following code the success response is working but when I try to destructure the error I get an error
but when I try to desctructure the error data I get an error. I tried typing it like
Beta Was this translation helpful? Give feedback.
All reactions