不能要求外部反应原生组件

时间:2015-09-24 11:59:57

标签: ios xcode react-native

我目前正在努力学习反应Native。在构建我的第一个应用程序时,我尝试从Github包含一个外部组件(https://github.com/voronianski/react-native-effects-view)。通过一步一步的小说法,我通过npm npm install react-native-effects-view --save安装了Component,并通过XCode包含了本机代码:

enter image description here

并通过var EffectsView = require('react-native-effects-view');要求组件。重新启动应用程序后,我得到了以下错误:Error: Requiring unknown module "react-native-effects-view". If you are sure the module is there, try restarting the packager.(我确实重启了大约1000次包)

也许有人可以指出我做的错误并解释我如何做到正确?

由于

丹尼尔

2 个答案:

答案 0 :(得分:1)

尝试运行react-native run-ios。你需要在npm install之后运行它。

答案 1 :(得分:1)

您需要再次捆绑您的应用,因为模拟器还没有react-native-effects-view模块的二进制文件

所以再次运行此命令

react-native run-ios
相关问题