πŸ“‚ React Native Project Structure (2025)

After installing React Native and running your first app, the next step is to understand the project structure. Knowing where files live, what they do, and how React Native organizes code will save you hours of confusion as your project grows.

βœ… Default Project Structure

When you run npx react-native init MyFirstApp, you get a folder layout like this:

React Native Project Structure in VS Code
MyFirstApp/
β”‚
β”œβ”€β”€ android/         # Native Android code (Gradle, Java/Kotlin)
β”œβ”€β”€ ios/             # Native iOS code (Xcode, Swift/Obj-C)
β”œβ”€β”€ node_modules/    # Installed npm dependencies
β”œβ”€β”€ index.js         # Entry point of the app
β”œβ”€β”€ App.js           # Main React component (your app starts here)
β”œβ”€β”€ package.json     # Project metadata + dependencies
β”œβ”€β”€ app.json         # Basic app configuration
β”œβ”€β”€ babel.config.js  # Babel compiler configuration
└── metro.config.js  # Metro bundler configuration (optional)

Let’s go through each of these step by step πŸ‘‡

πŸ“Œ android/ Folder

πŸ“Œ ios/ Folder

πŸ“Œ App.js

This is the heart of your React Native app. All your React components eventually connect here.

import React from "react";
import { Text, View } from "react-native";

export default function App() {
  return (
    
      Hello, React Native πŸš€
    
  );
}

πŸ“Œ index.js

Acts as the entry point. It tells React Native which component to start with.

import { AppRegistry } from 'react-native';
import App from './App';
import { name as appName } from './app.json';

AppRegistry.registerComponent(appName, () => App);

πŸ“Œ package.json

Defines project metadata, dependencies, and useful scripts.

{
  "name": "MyFirstApp",
  "version": "0.0.1",
  "scripts": {
    "start": "react-native start",
    "android": "react-native run-android",
    "ios": "react-native run-ios"
  },
  "dependencies": {
    "react": "18.x",
    "react-native": "0.79.x"
  }
}

πŸ“Œ app.json

Basic config file that defines the app’s name and displayName.

{
  "name": "MyFirstApp",
  "displayName": "My First App"
}

πŸ“Œ babel.config.js

Controls how modern JavaScript is compiled into code React Native can understand.

πŸ“Œ metro.config.js

Configuration for Metro (the JavaScript bundler used by React Native). Useful when you need to add support for images, custom fonts, or file types.

πŸ”„ React Native CLI vs Expo Project Structure

If you use Expo instead of React Native CLI, the structure is simpler:

MyExpoApp/
β”œβ”€β”€ App.js
β”œβ”€β”€ package.json
β”œβ”€β”€ app.json
└── node_modules/

No android/ or ios/ folders β€” Expo manages native code for you.

πŸ’‘ Best Practices for Organizing Code

πŸ“‹ Summary Table

Folder/File Purpose
android/ Native Android code (Gradle, Java, Kotlin)
ios/ Native iOS code (Xcode, Swift, Objective-C)
App.js Main React component, app UI starts here
index.js Entry point (registers the root component)
package.json Dependencies, scripts, metadata
app.json Basic app configuration
babel.config.js Transpiler configuration
metro.config.js Bundler configuration

πŸš€ Conclusion

By understanding the React Native project structure, you’ll be more confident in navigating and scaling your app. In the next step, we’ll dive into Core Components and Styling β€” the building blocks of every React Native application.