For the below example why type casting is not working in Flowtypes? What should be an ideal way of doing it?
type typeA = {
name: 'ben' | 'ken',
};
type typeB = {
name: string,
};
const objA: typeA = { name: 'ben' };
const objB: typeB = objA;
It gives error
Cannot assign `objA` to `objB` because in property `name`: Either string [1] is incompatible with string literal `ben` [2]. Or string [1] is incompatible with string literal `ken` [3].
However, for typescript, it is fine.