React Native - Project Setup

This lesson is part of a series on React Native.

Step 1 - Project Setup

Before starting this project, you should have completed this tutorial: https://reactnative.dev/docs/getting-started

Make sure you have the ES7+ React/Redux/React Native/JS Snippets extension installed

To create the project

Go here to get started: https://docs.expo.dev/get-started/create-a-project/

To create a blank project (the ./ tells it to make the project int he curent folder - not to make a new folder):

npx create-expo-app@latest --template blank ./

Note that this will initialize a Git repository

Todo: review the starter files:

assets/
App.js - root component
app.json - config file
index.js - entry point (loads the App component)

To set up your environemnt:

https://docs.expo.dev/get-started/set-up-your-environment/

Then start the app in VS Code:

npx expo start

In the terminal you'll see a QR code, which you can scan with Expo Go (on your device) to run the app

When you save changes it will live reload on your device! BUT if it doesn't Expo Go has a 'reload' feature (you shake your iPhone to see it, not sure about Android).

Shake the device to see the developer control panel

Running the app in the browser

You can also run it in the browser

First install this:

npx expo install react-dom react-native-web

Then to run it:

npm run web