在 NativeModules 中添加对象 [英] Add object in NativeModules

查看:60
本文介绍了在 NativeModules 中添加对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 https://github.com/dgladkov/react-react-native 项目中的 native-image-rotate

我用 yarn add react-native-image-rotate

我用 react-native link

我使用 import ImageRotate from 'react-native-image-rotate' 将它导入到我的组件中;

但是当我尝试使用它时,我有一个 Cannot read property 'rotateImage' of undefined

But when I try to use it I have a Cannot read property 'rotateImage' of undefined

我在 node_modules/react-native-image-rotate/index.js 中放了一个断点就行了:

I put a break-point in node_modules/react-native-image-rotate/index.js on the line:

const RCTImageRotateModule = NativeModules.ImageRotateModule;

并且在对象 NativeModules 中没有 ImageRotateModule 对象.

And in the object NativeModules there is no ImageRotateModule object.

如何在 NativeModules 中添加 ImageRotateModule ?

How Can I add ImageRotateModule in NativeModules ?

我使用的是 react-native 0.50.3

Im using react-native 0.50.3

谢谢

推荐答案

react-native link react-native-image-rotate

这篇关于在 NativeModules 中添加对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆