Sometimes I get an object CoolStuff from api.
It has two kinds.
I try using discriminated unions.
type CoolStuff =
{type: 1, goodshit: ...}|
{type: 2, badshit: ...}
And I have two Components for each of them.
I am so sure in component 1, the corresponding type will be 1.
I use react query to fetch the CoolStuff.
But I don't know how to cast it (or any other good way to make ts system happy)