如何同时导入组件和道具类型别名?

时间:2017-06-25 17:08:33

标签: javascript reactjs flowtype

export type PublicOrPrivateProps = {
  publicOrPrivate: PublicOrPrivateT
};

export default ({ publicOrPrivate }: PublicOrPrivateProps) => <Box>{publicOrPrivate}</Box>;

我试图像这样导入:

import type PublicOrPrivate, { PublicOrPrivateProps } from 'components/newrfq/reviewRFQ/PublicOrPrivate';

但它失败并出现以下错误:

  

从值位置引用的类型

1 个答案:

答案 0 :(得分:0)

您可以在名称列表中写下class StandardData { Q_GADGET public: int EmpId; QString Name; }; // You still have to call qRegisterMetaType if used for queued signals or // as property. qRegisterMetaType<StandardData>(); ,例如

type

此语法已在Flow 0.38.0中添加。