Re:TypeScript: Control flow analysis for destructured discri...
by tshaddox on Wednesday November 03, 2021 @04:50PM
(#29100091)
I believe this will also obviate a common recommendation to not destructure when using React Query: https://tkdodo.eu/blog/react-query-and-type-script#type-narr...
[ Parent
| on HN ]
Re:TypeScript: Control flow analysis for destructured discri...
by dragosmocrii on Wednesday November 03, 2021 @04:55PM
(#29100143)
Thanks for sharing this. I literally ran into the same issue yesterday, and was wondering why TS can't understand that I am discriminating on the isSucces property.