Create Expo App (self note)

DushyanthDushyanth
1 min read

This is a self note for installing React Native Expo app with app router for my projects using pnpm.

Project Installation:

  • pnpm dlx create-expo-app@latest Fitness --template (or)
    npx create-expo-app@latest Fitness --template

  • Choose a template: › Blank (TypeScript)

  • pnpm start to start the project.

App router:

Reference: https://docs.expo.dev/router/installation/

  • create src > app folder structure for the router.

  • Add “paths” to tsconfig.json, useful while importing.

  1. Install dependencies
pnpm dlx expo install expo-router react-native-safe-area-context react-native-screens expo-linking expo-constants expo-status-bar
  1. Setup entry point in package.json
{
  "main": "expo-router/entry",
}
  1. Modify project config in app.json; include “scheme” for deep-linking.
{
  "scheme": "your-app-scheme"
}

If you are developing your app for web, install the following dependencies:

pnpm dlx expo install react-native-web react-dom

Then include “bundler” in app.json for “web”

{
  "web": {
    "bundler": "metro"
  }
}

Now Start the app

pnpm start -- --clear

Create an index.tsx file inside app folder and you are ready to roll! 🎉

0
Subscribe to my newsletter

Read articles from Dushyanth directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Dushyanth
Dushyanth

A Full Stack Developer with a knack for creating engaging web experiences. Currently tinkering with GO.