Mobile development · Beginner · 16 min
How to Create Your First React Native App with Expo
By Padding · Updated 15 Nov 2026
Expo SDK 58 · Node.js 26
You will create an Expo SDK 58 project with TypeScript, look at what the template gives you, run it on your phone or in a simulator, replace the home screen with a small counter of your own, and check from the command line that the project bundles and passes expo-doctor.
On this page
React Native lets you build iOS and Android apps in TypeScript and React, with real native buttons, lists and navigation instead of a web page in a wrapper. Expo is the toolset around it: a project template, a development server, a set of ready-made libraries and a build service. Today, the React Native team itself recommends starting new apps with a framework such as Expo.
This tutorial creates a project with SDK 58, which uses React Native 0.88 and React 19.3, and builds a counter screen. You run the app on a phone with Expo Go, which loads your code over Wi-Fi without any native build. The command-line checks near the end (a web bundle and a project health check) work without a phone, so you can use them in a script or in CI.
Step 1 · Create the project
Make a folder for your app projects, and create the app. create-expo-app asks permission the first time to download itself. Answer y:
mkdir -p ~/expo-demo
cd ~/expo-demo
npx create-expo-app@latest hello-expoThe tool copies the default template, installs the dependencies with npm, and prints the commands to start. It takes a minute or two. The result is the folder hello-expo.
Check it worked
cd ~/expo-demo/hello-expo
node -e "const p=require('./package.json'); console.log(p.dependencies.expo, p.dependencies['react-native'], p.dependencies.react)"The output is ~58.0.25 followed by 0.88.1 and 19.3.0, or later patch versions of the same lines. The ~ before an Expo package version means patch updates only. SDK 58 pins the versions that work together, so do not change them by hand: use npx expo install <package> to add libraries, because it picks the right version for your SDK.
Step 2 · Look at what the template made
cd ~/expo-demo/hello-expo
ls
ls src/appThe first listing includes app.json, package.json, tsconfig.json, assets, src and node_modules. Three parts matter now:
src/appholds your screens. Expo Router, the routing library in the template, turns each file here into a screen:index.tsxis the home screen, andexplore.tsxis a second one._layout.tsxwraps them and decides how to move between them. The next tutorial covers it in depth.app.jsonis the app's configuration: its name, itsslug, its icons, and itsscheme(a prefix that lets links open the app). Editnameto change what appears under the app icon.package.jsonlists the dependencies and the scriptsstart,android,ios,webandlint.
The template also has an AGENTS.md file with notes for AI coding tools, a README.md, and a reset-project script that moves the example code aside when you want to start from a blank app. Do not run reset-project for this tutorial.
Step 3 · Run the app on a device
Start the development server from the project folder:
cd ~/expo-demo/hello-expo
npx expo startThe terminal shows a QR code and a menu of keys. To run the app:
- On a phone, open Expo Go (on iOS, point the Camera app at the QR code; on Android, scan it from inside Expo Go). The phone and the computer must be on the same network. If they cannot reach each other, restart with
npx expo start --tunnel, which routes the connection through Expo's servers and asks to install@expo/ngrok. - In the iOS Simulator, press
i. This needs macOS and Xcode. - On an Android emulator or a USB-connected device, press
a. This needs Android Studio's tools set up. - In a browser, press
wto run the web version, which is handy for quick layout checks.
The template's home screen appears. Edit a file, save it, and the app reloads on its own, with no new build. This is Fast Refresh. Leave the server running for the next step.
Expo Go includes a fixed set of native modules and is meant for learning and prototyping. When your app needs a native library that Expo Go does not include, you make a development build, which is covered in the EAS tutorial.
Step 4 · Write your own screen
Replace the contents of src/app/index.tsx with a counter. The screen keeps a number in React state, and a button changes it. It uses only components from React Native:
cd ~/expo-demo/hello-expo
cat > src/app/index.tsx <<'TSX'
import { useState } from 'react'
import { Pressable, StyleSheet, Text, View } from 'react-native'
export default function HomeScreen() {
const [count, setCount] = useState(0)
return (
<View style={styles.container}>
<Text style={styles.title}>Taps so far</Text>
<Text style={styles.count}>
{count}
</Text>
<Pressable
accessibilityRole="button"
accessibilityLabel="Add one tap"
onPress={() => setCount((current) => current + 1)}
style={({ pressed }) => [styles.button, pressed && styles.pressed]}
>
<Text style={styles.buttonText}>Tap me</Text>
</Pressable>
<Pressable accessibilityRole="button" onPress={() => setCount(0)}>
<Text style={styles.reset}>Reset</Text>
</Pressable>
</View>
)
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
gap: 16,
padding: 24,
backgroundColor: '#ffffff',
},
title: { fontSize: 20, color: '#1a1a1a' },
count: { fontSize: 72, fontWeight: '700', color: '#1a1a1a' },
button: {
minWidth: 160,
paddingVertical: 14,
paddingHorizontal: 24,
borderRadius: 12,
backgroundColor: '#208AEF',
alignItems: 'center',
},
pressed: { opacity: 0.7 },
buttonText: { color: '#ffffff', fontSize: 18, fontWeight: '600' },
reset: { fontSize: 16, color: '#208AEF', padding: 8 },
})
TSXNotes on the code. useState(0) gives a value and a function that replaces it, and React redraws the screen when it changes. setCount((current) => current + 1) computes the next value from the previous one, which stays correct when taps arrive quickly. StyleSheet.create holds styles as plain objects: React Native has no CSS files, and sizes are in density-independent points. Pressable is the general button component, and its style can be a function that receives pressed. The accessibility props tell a screen reader what the control is, and a screen reader reads the label of the button.
With the server still running, the phone shows the new screen after you save. Tap the button a few times and watch the number go up.
Check it worked
On the device, the count rises by one for each tap, and Reset puts it back to 0. Without a device, the next step checks the code instead.
Step 5 · Check the project from the command line
Two checks run without any device. An export bundles the app the way a build would, which exercises the whole JavaScript pipeline, including Expo Router and the Metro bundler:
cd ~/expo-demo/hello-expo
npx expo export --platform web
ls distThe export lists the bundle for each screen, with index and explore among them, and writes the result to dist. A bundling error, such as an import of a package that is not installed, stops the export with a message that names the file. Then check the project and its dependencies against the SDK:
npx expo-doctorexpo-doctor runs a set of checks on the project and ends with a line like 20/20 checks passed. No issues detected!. The count changes between SDK releases, so look for the words "No issues detected". Some checks contact Expo's servers, so it needs network access.
Troubleshooting
- The QR code opens but the app never loads: the phone and the computer are on different networks, or a firewall blocks the port. Try
npx expo start --tunnel. - Expo Go says the project is incompatible with the installed version: Expo Go supports the newest SDK only. Update Expo Go, or upgrade the project's SDK as described in Expo's upgrade guide.
Error: Cannot find moduleafter copying the project: runnpm installin the folder.node_modulesis not meant to be copied or committed.- A red error screen appears in the app: read the message, fix the file, and save. Fast Refresh clears it. Press
rin the terminal to reload everything. - Port 8081 is in use: the CLI offers another port. Answer
y, or stop the other server.
Step 6 · Clean up
Press Ctrl+C in the terminal that runs expo start. The exported dist folder is generated output and the demo folder is only for practice. If you want to keep the app to continue with the next tutorial, skip the deletion:
cd ~
rm -rf ~/expo-demoNext steps
- Add more screens, tabs and links between them: add navigation to an Expo app with Expo Router.
- Build the app for real devices and the stores: build and submit an Expo app with EAS.
- Learn the React side on the web: build a React 19 app with Vite.
Related tutorials
- How to Install Node.js 26 LTS on Ubuntu 26.04You will install Node.js 26 LTS with npm from the NodeSource apt repository on Ubuntu 26.04 so that apt keeps it patched, run a first script, set up global npm packages without sudo, and learn the checksum-verified tarball route as an alternative.
- How to Set Up a TypeScript 7 Project from ScratchYou will create a Node.js 26 project, install TypeScript 7, write a tsconfig.json you understand, compile two files to JavaScript, watch the compiler catch a type error, and add npm scripts for building, checking and running.
- How to Build a React 19 App with ViteYou will scaffold a React 19 and TypeScript app with Vite 8, run the dev server, replace the starter page with a small checklist built from components and state, then create a production build and serve it locally.
Need this done for you?
Padding does this work for growing companies, from the first diagnosis to a system that keeps working.
Get new tutorials