//Person Type
type Person{
canDisplayButton:boolean,
anotherEmail:string
}
const canEdit:boolean = person.canDisplayButton && data.anotherEmail;
Flow throws an error saying anotherEmail: string (This type is incompatible with boolean)
How can this be fixed?
If you're trying to determine whether data.anotherEmail
is defined, can you not use !!data.anotherEmail
to determine truthiness of the variable?
Collected from the Internet
Please contact javaer1[email protected] to delete if infringement.
Comments