Sign in
Log inSign up

Getting started with React Native

Run your first app successfully.

diana najjuma's photo
diana najjuma
·Oct 26, 2021·

2 min read

Hey hey!🤩

If you are new to mobile development with react native, the easiest way to get started is with Expo CLI. Expo is a set of tools built around React Native and, while it has many features, the most relevant feature for us right now is that it can get you writing a React Native app within minutes. You will only need a recent version of Node.js and a phone or emulator.

If you are already familiar with mobile development, you may want to use React Native CLI. It requires Visual studio code or Android Studio to get started. If you already have one of these tools installed, you should be able to get up and running within a few minutes. If they are not installed, you should expect to spend about an hour installing and configuring them.

Assuming that you have Node 10 LTS or greater installed, you can use npm to install the Expo CLI command line utility:

   $ npm install -g expo-cli

Then run the following commands to create a new React Native project called "CoolProject":

   $ expo init CoolProject

   $ cd CoolProject

   $ npm start       

OR

    $ expo start

This will start a development server for you.

Running your React Native application

Install the Expo client app on your iOS or Android phone and connect to the same wireless network as your computer. On Android, use the Expo app to scan the QR code from your terminal to open your project. On iOS, follow on-screen instructions to get a link.

Modifying your app

Now that you have successfully run the app, let's modify it. Open App.js in your text editor of choice and edit some lines. The application should reload automatically once you save your changes.

That's it!

Congratulations!😎 You've successfully run and modified your first React Native app.