how to properly compare enums and interface unions?
I have the following function in my api client:
I now need to use it in my react component:
Here
query.value
will be a union of IxUser | IxApiException
How can I check for the type and conditionally render something in react?
I can't use instanceOf either on IxUser (because it's an interface) or IxApiException
'cause it's an enum:
Am I approaching this whole typing thing wrongly in typescript? Coming from different languages this is how I would usually structure things but here it seems really hard to use those types0 Replies