With Typescript, you have to write custom Type Guards functions, whereas Flow is smart enough to infer type