I have this problem with typescript and can not understand what is wrong:
type Dogs = {bark: true};
type Cats = {meow: true};
........
.then((data: [Dogs, Cats][]) => {
const [dogs, cats] = data;
display(dogs, cats));
})
........
const display = (dogs: any, cats: any) => {
return ....
}
For now, everything is ok. When display function is written like this (dogs: any, cats: any) everything is fine, but if I change display function to:
const display = (dogs: Dogs, cats: Cats) => {
return ....
}
I receive an error in destructuring line (const [dogs, cats] = data;) that "dogs doesn't have meow key and cats doesn't have bark key"???
What I'm doing wrong?