I wanted to know if I it's possible to use inheritance while setting the useState type. What I mean is if have an interface like that:
interface PackageItem { id: number, name: string, address: string}
And another interface like that
interface Selectable { selected: boolean}
Now I want to create a state where I will have an array of selectable packages,so I tried something like this:
const [selectablePackages, setSelectablePackages] = useState<(PackageItem extends Selectable)[]>();
But I keep getting an error, which highlights the extends word, saying:
Parsing error: Unexpected token, expected ","
I'm not setting the state type correctly, how can I achieve this?