Skip to main content

Getting started

The fastest way to get started with React Native is to us Expo and run the app on your device. Feel free to use the React Native docs or Expo docs for reference.

You'll need:​

  • a computer (Mac, Windows or Linux)
  • a smartphone (iPhone or Android)

Follow React Native documentation​

https://reactnative.dev/docs/environment-setup

Install Expo​

https://docs.expo.dev/

Install VSCode (or another editor)​

https://code.visualstudio.com/download

Preview the app on your phone​

First, make sure that your phone is connected to the same WiFi network as your computer. This is really important!

Next you'll need to install the Expo client on your phone. This is the native shell Expo provides that lets you get started without having the build the native app yourself. Go to the App Store or Play store, search for "Expo" and install it. You will also have to create an Expo account if you don't already have one (don't worry - it's free!).

Finally, open the browser window that was opened when you ran the packages. See the QA code? If you're on Android, you can scan the code with your Expo app. On iOS, open the camera app to can the code. You will be prompted to "open in Expo".

At this point you should see something like this:

Expo hello world

And that's it! You're ready to start coding!

Folder Structure​

Let's have a look at what the plain Expo application template looks like:

Expo hello world

This is that my project structure looks like. Yours should look very similar. Let's see what's going on one by one:

  • /assets - this is where we store any assets we may want to use in our application, like images, videos, fonts and icons
  • /node_modules - these are all the packages we have installed that make up Expo and React Native. Whenever you npm install a new package, it gets added here. This folder should never be checked into source control
  • .gitignore - this is a file to tell .git which files and directories we want to omit from course control. node_modules is listed there
  • App.js - the main entry point to our application. This is where you'll start adding code!
  • app.json - another config file, mostly for expo metadata
  • babel.config.js - babel config, used to add the expo preset
  • package.json - this is where you list dependencies and add scripts
  • yarn.lock - you might not have this, but I had yarn installed, so expo added all my dependencies using yarn

All in all, the only files you will really focus on are the App.js and package.json