联盟类型在流动型

联盟类型在流动型

问题描述:

flowtype正确推断是不能当我使用他们作为像下面这样的函数的参数来确定以下给出类型联盟类型在流动型

componentToSelect。物业在对象类型未发现

码在线here

+0

那么,什么是你的问题? –

+0

我得到一个错误,我正在调查我做错了什么,或者我应该如何解决这个问题。 – locropulenton

的dispacth功能期待的动作,但没有确信这一行动有一个属性componentToSelect。 我应该先检查一下这个类型。

function dispatch(action: Action) { 
    if (action.type === 'SELECT') 
    console.log(action.componentToSelect); 
} 

查看它online

+0

github问题:https://github.com/facebook/flow/issues/3109 – locropulenton