reactjs - [流程]react-native : Required module not found

标签 reactjs react-native flowtype

.flowconfig

...
[libs]
node_modules/react-native/Libraries/react-native/react-native-interface.js
node_modules/react-native/flow
flow/
...

index.js

import { View } from 'react-native'; ---> produce: react-native. Required module not found.
...

也许我的 flowconfig 库设置已损坏?

  • react-native 0.42.3
  • flow-bin 0.45.0

最佳答案

这是一个快速解决方案,可以帮助我忽略 react-native 的流程相关错误

  1. 更改为您的项目目录

    cd my-awesome-project

  2. 在项目中创建一个名为 flow-typed 的目录(如果不存在)

    mkdir 流式

  3. 添加文件react-native.js

    触摸react-native.js

  4. 将以下内容添加到 react-native.js 并使用您喜欢的编辑器点击“保存”

    声明模块“react-native”{ 声明 module.exports: 任意; }

关于reactjs - [流程]react-native : Required module not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43777865/

相关文章:

reactjs - 如何使 react 选择选项可滚动

reactjs - 如何使用 Next.js 访问当前正在导航上加载的 url 或页面

javascript - REACT- DOM 突变警告含义

react-native - 如何在带有 React Native 的 Android 中隐藏状态栏?

javascript - 如何为 Flow 注释此函数

javascript - React/Redux 应用程序中的动态 header 子组件

ios - 运行react-native run-ios就成功了。但不启动模拟器

javascript - 从父未定义事件触发子函数

javascript - 如何匹配联合类型中的不同键

javascript - 流量: Specify type of the keys and values of an object