@wordpress/react-native-bridge Edit
Getting started Getting started
This package is not yet published to npm. You can use it locally:
$ npm install ./gutenberg/packages/react-native-bridge --save
Mostly automatic installation Mostly automatic installation
$ react-native link @wordpress/react-native-bridge
Manual installation Manual installation
iOS iOS
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜react-native-bridge
and addRNReactNativeGutenbergBridge.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNReactNativeGutenbergBridge.a
to your project’sBuild Phases
➜Link Binary With Libraries
- Run your project (
Cmd+R
)<
Android Android
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.reactlibrary.RNReactNativeGutenbergBridgePackage;
to the imports at the top of the file - Add
new RNReactNativeGutenbergBridgePackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:
include ':@wordpress_react-native-bridge'
project(':@wordpress_react-native-bridge').projectDir = new File(rootProject.projectDir, './gutenberg/packages/react-native-bridge/android') - Insert the following lines inside the dependencies block in
android/app/build.gradle
:
implementation project(':@wordpress_react-native-bridge')
Usage Usage
import RNReactNativeGutenbergBridge from '@wordpress/react-native-bridge'; // TODO: What to do with the module? RNReactNativeGutenbergBridge;