Mobile App Development
Hands-onBeginner 30 min· Foundations · 2 of 12

Start an app with Expo (React Native)

Create an Expo app, run it on your own phone with Expo Go, and build a first screen with View, Text and Pressable. Learn how React Native differs from HTML and CSS on the web.

In this tutorial you will create a new Expo app, run it on your own phone, and change it to be a small Brew & Bean welcome screen with a tap counter. You will learn what the files in the project do and how React Native components differ from HTML.

Prerequisites: Node.js (LTS version) installed, a code editor such as VS Code, basic JavaScript, and ideally some React (components, props, useState). You need an Android phone or iPhone on the same Wi-Fi network as your computer. No Android Studio is needed.

What you need

  1. 1Check Node is installed: run node --version in a terminal. If the command is not found, install the LTS version from nodejs.org.
  2. 2On your phone, install Expo Go from the Play Store (Android) or the App Store (iPhone). Expo Go is a ready-made app that loads your project over Wi-Fi, so you can test without building anything.
  3. 3Connect the phone and the computer to the same Wi-Fi network. College and office networks sometimes block this; a phone hotspot shared to your laptop works as a fallback.

Step 1: Create the project

Terminal
npx create-expo-app@latest brew-bean
cd brew-bean

create-expo-app downloads a starter project and installs its packages. The first run can take a few minutes on a slow network.

The default starter uses TypeScript and Expo Router, and includes example screens. To keep things simple we will start from a clean slate. The starter has a script for this.

Terminal
npm run reset-project

This script moves the example code into a folder called app-example and leaves a minimal app folder. If it asks whether to move or delete the example files, either answer is fine; moving is safer.

Step 2: Run it on your phone

Terminal
npx expo start

Starts the development server (called Metro) and prints a QR code.

  1. 1On Android, open Expo Go and choose Scan QR code. On iPhone, scan the QR code with the normal Camera app.
  2. 2Wait for the bundle to load. You should see a white screen with the text "Edit app/index.tsx to edit this screen."
  3. 3Leave the terminal running. It is your development server.
What you see on the phone
Edit app/index.tsx to edit this screen.

Phone will not connect?

If the phone cannot connect, the usual causes are different Wi-Fi networks, a firewall on the laptop, or a network that blocks device-to-device traffic. Try npx expo start --tunnel (Expo will offer to install a helper package). It is slower but works across networks.

Step 3: Know your project

The files that matter

File or folderWhat it is for
app/Your screens. Each file here becomes a screen (this is Expo Router, covered in a later lesson)
app/_layoutThe root layout that wraps every screen
app/indexThe first screen (the home route, /)
app.jsonApp settings: name, icon, splash screen, package ids
package.jsonDependencies and scripts such as npm start
assets/Images and fonts
node_modules/Installed packages. Never edit or commit this

The starter's screens are .tsx files (TypeScript). In these lessons we write plain JavaScript, which Expo supports in the same project. So delete app/index.tsx and create app/index.js. If you prefer TypeScript, the code works in .tsx once you add types for props.

Step 4: Write your first screen

In React Native there is no div, p or button. You use built-in components: View is a box (like div), Text shows text (all text must be inside it) and Pressable handles taps. Styles are JavaScript objects made with StyleSheet.create, not CSS files.

app/index.js
import { useState } from "react";
import { View, Text, Pressable, StyleSheet } from "react-native";

export default function Home() {
  const [cups, setCups] = useState(0);

  return (
    <View style={styles.container}>
      <Text style={styles.title}>Brew & Bean</Text>
      <Text style={styles.subtitle}>Indiranagar, Bengaluru. Open 8 am to 10 pm.</Text>

      <Pressable style={styles.button} onPress={() => setCups(cups + 1)}>
        <Text style={styles.buttonText}>Add a coffee</Text>
      </Pressable>

      <Text style={styles.count}>Cups in your order: {cups}</Text>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: "center",
    justifyContent: "center",
    padding: 24,
    backgroundColor: "#fff8f0",
  },
  title: { fontSize: 32, fontWeight: "bold", color: "#4a2c17" },
  subtitle: { fontSize: 16, color: "#6b4f3a", marginTop: 4, marginBottom: 32 },
  button: {
    backgroundColor: "#4a2c17",
    paddingVertical: 14,
    paddingHorizontal: 28,
    borderRadius: 10,
  },
  buttonText: { color: "white", fontSize: 18 },
  count: { fontSize: 18, marginTop: 24 },
});

Save the file. The app on your phone reloads by itself (Fast Refresh) and keeps its state where possible.

What you should see
A cream-coloured screen. The title "Brew & Bean" and the address are in the middle, with a brown "Add a coffee" button. Each tap increases the number in "Cups in your order".

Compare with React for the web. The useState hook and JSX work the same. What changes: onPress instead of onClick, no CSS files, no HTML tags, and layout uses flexbox with a column direction by default (on the web the default is row).

Step 5: See errors and the developer menu

  1. 1Break something on purpose: change <Text> in the title to <Txt> and save. A red error screen appears on the phone with the message and the line. Fix it and the app recovers.
  2. 2In the terminal running Expo, press r to reload the app, m to toggle the developer menu, and a to open it on an Android emulator if you have one.
  3. 3On the phone, shake the device to open the developer menu.

Read the red error screen from the top. The first line is usually the real cause. Copy it into a search or into an AI assistant along with the file contents.

Prompt · Explain a React Native error
I am learning React Native with Expo. Explain this error in simple English, tell me which line is probably wrong and show the fix.

Error message:
[paste the red-screen message]

My file:
[paste the file]

What to expect: A good answer names the cause (for example text outside a Text component, or a misspelled component), points to the line and shows corrected code. Check it against the Expo or React Native docs before relying on it.

Expo Go and development builds

Expo Go is perfect for learning. It already contains many common libraries (camera, location, storage). Its limit is that it only contains the code that Expo chose to include. When you later need a library with custom native code, or features that Expo Go does not support, you make a development build: your own version of Expo Go that includes your libraries. It is made with EAS Build or locally, and needs more setup. We cover building in *Build and publish to the Play Store*.

Common mistakes

Watch out for

  1. Putting text directly inside a View. All text must be inside a Text component.
  2. Forgetting flex: 1 on the outer container, so the content does not fill the screen.
  3. Installing packages with plain npm install when an Expo package is needed. Use npx expo install package-name so Expo picks a version that matches your SDK.
  4. Closing the terminal. The dev server must keep running while you test.

Try it: Make it a real counter

Extend the screen. Add a "Remove" button that lowers the count but never below 0. Show the price as well: a coffee costs ₹180 (the cappuccino from the Brew & Bean menu) so display "Total: ₹..." under the count. Change the button colour while the count is 0.

Key takeaways

  1. Create a project with npx create-expo-app@latest, run it with npx expo start and scan the QR code with Expo Go.
  2. Screens live in the app folder. Edits show instantly with Fast Refresh.
  3. React Native uses View, Text and Pressable instead of HTML tags, and StyleSheet objects instead of CSS.
  4. Install packages with npx expo install so versions match your Expo SDK.
  5. Expo Go is for learning; a development build is needed for libraries with custom native code.

Check yourself

Finishing the quiz marks the lesson as done.

1. In React Native, where must text be placed?

2. What does npx expo start do?

3. Which command should you use to add a library to an Expo project?

4. Your phone shows no connection to the dev server. Which fix is most likely to work?

5. What is the main difference between onClick in web React and the equivalent in React Native?

Saved on this device. Create a free account to keep it on every device.

Practise this with Sam

A real mock interview, out loud, with an honest scorecard. Free to start.

Start free