Summary: In this tutorial, you will learn how to create your first React Native app called Hello World.
Prerequisites
This tutorial assumes that you have set up the React Native development environment on your computer and have the Expo Go app installed on your phone.
Creating a new React Native project
We’ll create a new Expo and React Native project using the create-expo-app command. This create-expo-app tool allows you to quickly initialize a project with a template.
Step 1. Open your terminal and run the following command to create a new project called helloworld:
npx create-expo-app helloworld --template blankCode language: plaintext (plaintext)In this command:
- The
create-expo-appcommand creates thehelloworlddirectory for the project. - The
--template blankoption instructs the command to install all the necessary packages and initialize a blank React Native project.
Step 2. Navigate to the project directory:
cd helloworldCode language: plaintext (plaintext)Step 3. Run the app from your terminal using the following command:
npm startCode language: plaintext (plaintext)The npm start will execute the npx expo start command that runs the app. It’ll return the following output: