【发布时间】:2018-12-24 02:20:54
【问题描述】:
当我对应用程序中的各种组件运行一些单元测试时,我不断收到这个烦人的警告:
NativeModules.RNViewShot is undefined. Make sure the library is linked on the native side.
在我的根目录中,我运行'react-native link',我在控制台中看到了这个:
rnpm-install info Platform 'ios' module react-native-view-shot is already linked
rnpm-install info Platform 'android' module react-native-view-shot is already linked
rnpm-install info Linking assets to ios project
rnpm-install info Linking assets to android project
rnpm-install info Assets have been successfully linked to your project
这里给出了什么>?
Platform: MacOS,
Editor: VSCode,
react: "16.4.0",
react-native: "0.54.2",
react-native-view-shot: "^2.4.0",
【问题讨论】:
-
它在开发版本上工作吗?或者尝试手动链接。
-
在开发构建中工作正常仅在单元测试中给出警告。
标签: reactjs react-native jestjs