Return type of data
when placeholderData
is provided
#2278
Unanswered
zachdtaylor
asked this question in
Q&A
Replies: 1 comment
-
Yes, it’s a request that comes up a lot, but neither placeholderData nor initialData can currently narrow the type. |
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.
-
I noticed that even when
placeholderData
is provided as auseQuery
option, thedata
attribute on the result can still be undefined according to TypeScript. Is that accurate? I thought thedata
attribute would never be undefined ifplaceholderData
was provided. For example, if I dothe type of
data
isstring | undefined
, but I thought it should just bestring
or maybestring | 'Loading...'
.Beta Was this translation helpful? Give feedback.
All reactions