React Native Starter Setup
DS
Darshan Suthar

React Native Starter Setup

1. Create Project

npx create-expo-app myApp

Go inside:

cd myApp

Start:

npm start

Run on phone using Expo Go.


2. Clean Default App

Open:

App.js

Replace with:

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

export default function App() {
  return (
    <View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
      <Text>Starter App</Text>
    </View>
  );
}

3. Create Folder Structure

Create:

app/
screens/
components/
services/
hooks/

Move logic into screens instead of keeping everything in App.


4. Create First Screen

screens/Home.js
import { View, Text, StyleSheet } from "react-native";

export default function Home() {
  return (
    <View style={styles.container}>
      <Text style={styles.title}>Home Screen</Text>
    </View>
  );
}

const styles = StyleSheet.create({
  container: { flex: 1, justifyContent: "center", alignItems: "center" },
  title: { fontSize: 22, fontWeight: "600" },
});

5. Setup Navigation

Install:

npm install @react-navigation/native
npx expo install react-native-screens react-native-safe-area-context
npm install @react-navigation/native-stack

Update App.js:

import { NavigationContainer } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import Home from "./screens/Home";

const Stack = createNativeStackNavigator();

export default function App() {
  return (
    <NavigationContainer>
      <Stack.Navigator>
        <Stack.Screen name="Home" component={Home} />
      </Stack.Navigator>
    </NavigationContainer>
  );
}

Now navigation works.


6. Add Second Screen

screens/Profile.js
import { View, Text, Button } from "react-native";

export default function Profile({ navigation }) {
  return (
    <View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
      <Text>Profile</Text>
      <Button title="Go Home" onPress={() => navigation.navigate("Home")} />
    </View>
  );
}

Update navigator:

<Stack.Screen name="Profile" component={Profile} />

7. API Service Example

Create:

services/productService.js
export async function getProducts() {
  const res = await fetch("https://api.example.com/products");
  return res.json();
}

Use in screen:

useEffect(() => {
  getProducts().then(setProducts);
}, []);

8. Reusable Component Example

components/ProductCard.js
import { View, Text } from "react-native";

export default function ProductCard({ item }) {
  return (
    <View style={{ padding: 12 }}>
      <Text>{item.title}</Text>
    </View>
  );
}

Final Structure

screens/
components/
services/
hooks/

This is enough to start building real apps.

#React Native starter setup#Expo React Native tutorial#React Native navigation example#React Native folder structure beginner#React Native API integration#React Native first app guide#React Native screens setup#Expo starter app tutorial#React Native project structure#React Native beginner code guide
DS

Darshan Suthar

JavaScript Developer (Next.js & React Native)

I build accessible and high-performance modern web applications. Passionate about open source, UI/UX design, and sharing knowledge through writing.