v3 is it expected following the simple example in the docs with fetch causes TS error? #4149
Unanswered
michaelaflores
asked this question in
Q&A
Replies: 1 comment
-
The typescript docs have been updated for v4: also, see: https://tkdodo.eu/blog/react-query-and-type-script |
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.
-
When following the v3 "basic" example, replacing the use of Axios with
fetch
results in a TS issue whereerror
is of typeunknown
(I assume actually using Axios works here).I'm curious if this is expected when using
fetch
and following the examples in the docs?This is resolved by providing a type in the second argument to the
useQuery
generic but I was wondering why the docs by default don't mention anything other than that a custom hook must specify the error type, when this is also true when just usinguseQuery
directly as the docs show.i..e this example has the same error
Beta Was this translation helpful? Give feedback.
All reactions