我想将流类型注释添加到一个包含以ES6样式定义的函数的类中,下面是正确分析的:
/* @flow */
class Product {
items: Array<string>;
addItem = (item:string) => {
this.items.push(item)
};
}如果我添加export default来导出Product类,我会得到:
class property `addItem` missing type annotation.发布于 2016-08-02 04:01:22
原来我在全球范围内安装了一个旧版本的Flow,版本为0.23.0,这是不兼容的。升级到flow 0.30.0修复了此问题。
https://stackoverflow.com/questions/38705716
复制相似问题