How to Create a React Native Project with Expo: The Complete Initialization Guide

The recommended way to create a React Native project is using the create-expo-app CLI, which orchestrates project scaffolding, template selection, package manager detection, Git initialization, and dependency installation through a single command.

Setting up a new React Native application requires careful orchestration of tooling, templates, and platform-specific configurations. The expo/expo repository provides the official Create Expo App workflow—the industry-standard method to create a React Native project with minimal friction. This guide examines the source code implementation to explain exactly how the initialization process works under the hood.

The Create Expo App Entry Point

The modern approach to create a React Native project uses the create-expo-app package, invoked via npx create-expo-app or the legacy expo init command. According to the source code in expo/expo, the main orchestration logic resides in packages/create-expo/src/createAsync.ts, which coordinates seven distinct initialization phases to ensure a consistent developer experience across platforms.

Step-by-Step Initialization Workflow

1. Project Root Detection

The CLI first resolves the target directory name (defaulting to my-app) and creates the project folder structure. The createAsync.ts module handles directory validation and ensures the target path is available before proceeding with template extraction.

2. Template Selection

Users select from managed workflow templates stored in the templates/ directory, such as expo-template-blank or expo-template-blank-typescript. Each template includes a pre-configured package.json defining the React Native and Expo SDK dependencies required for specific use cases, from minimal setups to tab-based navigation structures.

3. Package Manager Detection

Before installing dependencies, the CLI executes resolvePackageManager.ts to detect whether to use npm, yarn, or pnpm. The detection algorithm scans for existing lock-files in parent directories, defaulting to npm if no lock-files are found, ensuring compatibility with your existing toolchain.

4. Git Repository Initialization

Unless the project resides within an existing Git repository, the initGitRepoAsync function in packages/create-expo/src/utils/git.ts initializes a new repo and creates the initial commit. This ensures version control is established immediately upon project creation without manual git init commands.

5. Dependency Installation

The CLI invokes the appropriate install command through packages/create-expo/src/utils/npm.ts, executing npm install, yarn, or pnpm i based on the detected package manager. This step downloads React Native, Expo SDK, and template-specific dependencies into the newly created project directory.

6. iOS-Specific Setup

For macOS environments where the template includes native iOS code, packages/create-expo/src/Template.ts executes pod install to configure CocoaPods dependencies. According to the source implementation, CocoaPods failures are reported but do not abort the initialization process, allowing the project to remain functional for Android development even if iOS setup is incomplete.

7. Telemetry and Analytics

The first CLI execution triggers initializeAnalyticsIdentityAsync in packages/create-expo/src/telemetry.ts, generating an anonymous identifier to help Expo improve tooling without collecting personal data or project-specific information.

Practical Commands to Create a React Native Project


# Method 1: Using npx (recommended, no global install required)

npx create-expo-app my-awesome-app

# Method 2: Global installation (legacy approach)

npm i -g expo-cli
expo init my-awesome-app

During execution, the interactive wizard prompts for template selection (blank, tabs, or bare-minimum), then automatically handles package manager detection, Git initialization, and dependency installation. On macOS, the CLI additionally runs pod install for iOS compatibility.

After initialization completes, start the development server:

cd my-awesome-app
npm start

Summary

  • The Create Expo App workflow in expo/expo provides the canonical method to create a React Native project through npx create-expo-app.
  • The initialization process follows a seven-step workflow defined in packages/create-expo/src/createAsync.ts, covering everything from directory creation to telemetry setup.
  • Package manager selection is automatic via resolvePackageManager.ts, supporting npm, yarn, and pnpm without manual configuration.
  • Git repositories are initialized automatically by packages/create-expo/src/utils/git.ts unless already present in a parent directory.
  • iOS projects receive automatic CocoaPods configuration through packages/create-expo/src/Template.ts, with graceful error handling for incomplete macOS development environments.

Frequently Asked Questions

What is the difference between expo init and npx create-expo-app?

The npx create-expo-app command uses the modern create-expo package and is the recommended approach, while expo init requires the legacy global expo-cli installation. Both tools perform the same underlying initialization logic found in the expo/expo repository, but create-expo-app requires no global dependencies and always uses the latest version available.

Can I use TypeScript when I create a React Native project with Expo?

Yes. The template system includes expo-template-blank-typescript and other TypeScript variants. During the interactive setup, select the TypeScript option to receive a project with .tsx files and proper TypeScript configuration pre-installed, including appropriate @types packages.

Why does the CLI install CocoaPods automatically on macOS?

The Template.ts module runs pod install to configure the iOS native dependencies required for React Native modules. This automation eliminates manual CocoaPods configuration, though the source code implements non-fatal error handling to ensure Android development can proceed on systems with incomplete iOS setups.

Does Create Expo App collect personal data during initialization?

No. The telemetry system in telemetry.ts generates only an anonymous identifier on first run to track CLI usage patterns. No personal information, project names, code content, or directory structures are transmitted during the create-expo-app initialization process.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →