Skip to content

Type narrowing lost when destructuring the result of useQuery #6162

Answered by kykungz
kykungz asked this question in Q&A
Discussion options

You must be logged in to vote

It seems to be a missing feature of TypeScript, that type narrowing doesn't work when destructuring discriminated union within a destructured array.

microsoft/TypeScript#55664

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
1 reply
@kykungz
Comment options

Comment options

You must be logged in to vote
1 reply
@TkDodo
Comment options

Answer selected by kykungz
Comment options

You must be logged in to vote
3 replies
@token-ed
Comment options

@TkDodo
Comment options

@token-ed
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants