When I receive a response from an API, it can be one of two options:
geoblocked: false
or
geoblocked: {
country: {
id: number;
}
}
I initially created the interface below to handle this situation:
export interface Country {
country: {
id: number;
name: string;
countryCode: string;
};
}
export interface SiteDataType {
geoblocked: Country | boolean;
}
However, when the 'country' object exists, I encountered a type error. How can I properly handle the expected type of boolean false?