【发布时间】:2018-04-06 01:54:27
【问题描述】:
我不明白 Flow 在抱怨什么。当我对这两个文件运行流程时,我收到错误Property MyType is missing in exports [1]
定义类型的文件:
// types.js
// @flow
export type MyType = {
from: string,
to: string,
subject: string,
text: string,
};
文件使用类型:
// myfile.js
// @flow
const { MyType } = require('./types') // flow error on this line
const foo = ({
from = 'default',
to,
subject,
text,
}: MyType) => {
doSOmething();
}
导出类型的正确语法是什么?它在 Flow 文档中的什么位置,似乎只谈论导出整个模块?
【问题讨论】:
标签: flowtype