I have a Table component with props like this:
type TableProps<T extends object> = {
columns: Column<T>[];
data: T[];
expandable?: boolean;
};
I'd like to make it so that if the expandable prop is provided/set to true, it enforces that T extends {details: ReactNode} instead of T extends object, as the details node is what I want to render when expanding a row.
Is it possible to use generics in this way?