Workshop: React Native Custom Modules
This workshop will walk you through the process of creating a Custom Module from scratch in React Native, for Android and iOS.
Prerequisites
This is an advanced workshop, that requires prior experience using React Native, as we won't cover the basics of React or React Native.
The following tools are required to follow this workshop:
- react-native-cli + watchman (follow Getting Started with React Native CLI Quickstart, NOT the Expo Guide)
- Android Studio
3+
and an AVD with API level26+
- for Apple users, Xcode
10.x
Setup
-
Fork this repository
-
Clone it locally
-
Go to your project folder:
cd workshop-react-native-custom-modules
-
Install dependencies:
npm install
-
Run the packager:
npm start
-
Start the project on Android:
- Open Android Studio
- Open the
./android
project in Android Studio - Start an AVD
- Run the app
-
Start the project on iOS:
- Open Xcode
- Open
./ios/RNCustomModules.xcodeproj
in Xcode - Run the app in a simulator
If everything goes well, you should see the following screen, which doesn't do anything: