简体   繁体   English

使用FlowType的React Native:导出和导入js接口

[英]React Native with FlowType: Exporting and importing js interfaces

I'm using FlowType on a React native project and I want to put a JavaScript interface in its own file for sharing throughout the project. 我在React本机项目上使用FlowType,我想将JavaScript接口放在其自己的文件中以在整个项目中共享。 Thoughts? 有什么想法吗?

The trick is to use export type and import type . 诀窍是使用导出类型导入类型

I found the answer here: 我在这里找到了答案:

https://flowtype.org/docs/modules.html#type-imports--exports https://flowtype.org/docs/modules.html#type-imports--exports

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM