- Clone this repository
git clone git@github.com:facebook/react-native.git
. - Change the
react-native
field inreact-native/template/package.json
to the absolute path of the react native repo, for example:"react-native": "file:///Users/username/react-native"
. - Run
npx react-native init TestApp --template file:///Users/username/react-native
(If you don't havenpx
, runbrew install npm
).
A number of manual steps have to be done for developing React Native from source:
- Change
implementation "com.facebook.react:react-native:+"
toimplementation project(':ReactAndroid')
inandroid/app/build.gradle
. - In
android/settings.gradle
, add:
include ':ReactAndroid'
project(':ReactAndroid').projectDir = new File(
rootProject.projectDir, '../node_modules/react-native/ReactAndroid')
- Add
classpath 'de.undercouch:gradle-download-task:3.4.3'
under dependencies inandroid/build.gradle
. - Run
react-native run-android
which should now build and install the app on a connected device/emulator.