How to create a React Native app and make your first change

How to create a React Native app and make your first change

This post is recommended for folks with a baseline understanding of Javascript or other software development language. If you aren’t comfortable writing a simple program in a language, I’d recommending writing one first.

In this post, we’ll walkthrough how to create a React Native codebase, and make one change in the ios simulator locally.

First, make sure you have the following software installed:

  • Node.js, at least version 10.11.0. Run node -v in the terminal to see if it is installed.
  • xCode – installing at least 12.0 beta 5 will give you ios 14 support, which will be helpful later.
  • Android Studio – at least version 3.2
  • git – if you have a mac you’ll already have it
  • react-native-cli tools. This should do it for you: npm install -g react-native-cli
  • Next, visit your command line.
  • Navigate to your desktop or favorite folder to install code.
  • Type react-native init myAwesomeNewProject and press enter.
  • This command will create a react native app in a folder titled “myAwesomeNewProject”
  • Type cd myAwesomeNewProject
  • Type react-native run-ios
  • You should see an iOS simulator launch, with your app installed and running!

This seems way to easy to be real. But yes, this is an actual app up-and-running with React Native that can be deployed to the app store.

Let’s make a simple change, save it, and view the saved change in the simulator.

  • Open your myAwesomeNewProject in an IDE, like vsCode.
  • Open App.js in the root of the project.
  • Change this code block:
Edit <Text style={styles.highlight}>App.js</Text> to change this
                screen and then come back to see your edits.

to this code block:

 Edited <Text style={styles.highlight}>App.js</Text> and made my first change in react native!

Alright! We made a change! Save the file. View the simulator. You made your first code change in React Native! Well done. 💪

In the next series of posts we’ll go much deeper into building apps that shine, from authentication, to analytics, to beautiful navigation transitions, to app deploy best practices, CI/CD, push notifications, offline-first data patterns, and more!

Let’s get moving.