Replies: 1 comment
-
the
|
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.
-
I'm currently working on a typescript project that gives me this annoying error:
I get that this are happening because of that
undefined
:The point is that my implementation of the service never will be
undefined
, what makes me think that thisundefined
came from inside of the typing of thereact-query
. It seems to me that the lib tries to handle the error data of our services for us, but imo that's about to us to type and define. On my case for instance, I have a method that return a key-value object or an empty object:If we get the inferred type by the method, without
react-query
:But for some reason
react-query
infers that it could beundefined
which isn't true. By far,react-query
has a really good type inference on the lib so maybe is a good idea to let us to define all the types on the service is the best approach.But perhaps I'm missing something or doing something wrong, in my situation is there a real case that this
undefined
will truly appears?Beta Was this translation helpful? Give feedback.
All reactions