1.0.0 • Published 7 years ago

react-native-nativemodule-example-duang v1.0.0

Weekly downloads
4
License
ISC
Repository
github
Last release
7 years ago

#react-native-BGNativeModuleExample

下面两篇博客的示例代码:

ReactNative之原生模块开发并发布——iOS篇

ReactNative之原生模块开发并发布——android篇

##安装

rnpm install react-native-nativemodule-example

##集成 reactNative0.29版本以后,需要在MainApplication.java文件的getPackages方法中添加:

@Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
              new MainReactPackage(),
              new BGNativeExamplePackage()
      );
    }

##使用

import BGNativeModuleExample from 'react-native-nativemodule-example';

BGNativeModuleExample.testPrint("Jack", {
    height: '1.78m',
    weight: '7kg'
});

##Example

npm install