- At this point, our app has no references to React Native, so we'll start by installing it. In the app's root folder, in the Terminal, install React Native from the command line using yarn:
yarn add react-native
Alternatively, you can use npm:
npm install react-native --save
- We'll also need a Node.js script for starting the React Native app. Let's open package.json and add the following property as a member of the scripts object:
"start": "node node_modules/react-native/local-cli/cli.js start"
- We only need a very simple React Native app for this recipe. Let's create an index.android.js file with the following boilerplate app:
import React, { Component } from 'react';import { AppRegistry, StyleSheet, View, Text } from ...