1. ์ฌ์ ์๊ฑด & ์์คํ ์๊ตฌ์ฌ์ (Prerequisites & System Requirements)
๐ป ์์คํ ์ค์น ๋ฐ ์คํ ์๊ตฌ์ฌ์ (System Requirements)
| ํญ๋ชฉ | ์ต์ ์ฌ์ (Minimum) | ๊ถ์ฅ ์ฌ์ (Recommended) | ์ฐธ๊ณ ๋ฐ ๋น๊ณ |
|---|---|---|---|
| ์ด์์ฒด์ (OS) | Windows 10/11 64-bit (Android ์ ์ฉ), macOS 14+ (iOS ๋น๋ ํ์) | macOS Sequoia 15+ (Apple Silicon M1/M2/M3/M4) | iOS/iPadOS ํ๊น ๋น๋ ๋ฐ Xcode ์๋ฎฌ๋ ์ดํฐ ๊ตฌ๋์ Mac ํ์ |
| CPU | 4 ์ฝ์ด ์ด์ (Intel Core i5/i7, AMD Ryzen 5) | 8 ์ฝ์ด ~ 16 ์ฝ์ด ์ด์ (Apple Silicon M-Series ๊ถ์ฅ) | C++ NDK ์ปดํ์ผ, Gradle ๋ณ๋ ฌ ๋น๋ ๋ฐ Metro ๋ฒ๋ค๋ฌ ๊ฐ์ |
| ๋ฉ๋ชจ๋ฆฌ (RAM) | 8 GB ์ด์ (Expo Go ํ ์คํธ ๊ธฐ์ค) | 16 GB ~ 32 GB ์ด์ | Android ์๋ฎฌ๋ ์ดํฐ + Xcode ์๋ฎฌ๋ ์ดํฐ + IDE ๋์ ๊ตฌ๋ |
| ๋์คํฌ (Storage) | 20 GB ์ด์์ ์ฌ์ ๊ณต๊ฐ | 60 GB ~ 100 GB ์ด์์ ๊ณ ์ NVMe SSD | Xcode(30GB+), Android SDK/NDK(15GB+), ์๋ฎฌ๋ ์ดํฐ ๊ฐ์ ์ด๋ฏธ์ง |
| ๋คํธ์ํฌ / ๋ฐํ์ | Node.js 20.x LTS, JDK 17/21, Git, Watchman | Node.js 22.x LTS, CocoaPods, Android Studio Ladybug+, Xcode 16+ | ํ๋์จ์ด ๊ฐ์ํ (VT-x / AMD-V / Hyper-V) ํ์ฑํ ํ์ |
๐ Expo (Managed) vs React Native CLI (Bare) ๋น๊ต
| ํน์ฑ | Expo (Managed Workflow) (ํ๋ ํ์ค ๊ถ์ฅ) | React Native CLI (Bare) |
|---|---|---|
| ์ด๊ธฐ ํ๊ฒฝ ์ค์ | npx create-expo-app ํ๋๋ก 1๋ถ ๋ง์ ์๋ฃ | Android Studio, Xcode, ํ๊ฒฝ ๋ณ์ ์ง์ ์๋ ๊ตฌ์ฑ |
| ์ค๊ธฐ๊ธฐ ํ ์คํธ | ๋ชจ๋ฐ์ผ ์ฑ Expo Go๋ก QR ์ฝ๋ ์ค์บ ์ฆ์ ์คํ | USB ๋๋ฒ๊น ์ฐ๊ฒฐ ๋๋ ์ธ์ฆ์ ์ฌ์ด๋๋ก๋ฉ ํ์ |
| ๋ค์ดํฐ๋ธ ์ฝ๋ ์์ | Config Plugins(ํ๋ฆฌ๋น๋)๋ก ์ฝ๋ ์๋ ์์ฑ | android/, ios/ ๋ค์ดํฐ๋ธ ํ๋ก์ ํธ ์ง์ ์์ |
| ํด๋ผ์ฐ๋ ๋น๋/๋ฐฐํฌ | **EAS (Expo Application Services)**๋ก Mac ์์ด๋ iOS ๋น๋ ๊ฐ๋ฅ | ๋ก์ปฌ์ Mac ํ๊ฒฝ์ด ์์ด์ผ iOS ์์นด์ด๋ธ ๋น๋ ๊ฐ๋ฅ |
2. ํต์ฌ ๋ฉํ ๋ชจ๋ธ (New Architecture: Fabric & TurboModules)
๊ณผ๊ฑฐ React Native๋ ์๋ฐ์คํฌ๋ฆฝํธ์ ๋ค์ดํฐ๋ธ ๊ฐ์ ๋น๋๊ธฐ JSON ๋ธ๋ฆฟ์ง(Bridge)๋ก ํต์ ํ์ฌ ๋๋์ ๋ฐ์ดํฐ๋ ์ด๋น 60ํ๋ ์ ์ ์ค์ฒ ์ ํ๋ ์ ๋๋์ด ๋ฐ์ํ์ต๋๋ค. ์ต์ React Native์ New Architecture๋ **JSI(JavaScript Interface)**๋ฅผ ํตํด C++ ์์ค์์ ์ง์ ๋ฉ๋ชจ๋ฆฌ๋ฅผ ๊ณต์ ํฉ๋๋ค.
[๋ ๊ฑฐ์ ์ํคํ
์ฒ (Legacy Bridge)]
JS Thread (React) ====[ ๋น๋๊ธฐ JSON ์ง๋ ฌํ Bridge (๋ณ๋ชฉ) ]====> Native OS (iOS/Android)
[๋ด ์ํคํ
์ฒ (New Architecture - 0.76+ ๊ธฐ๋ณธ ํ์ค)]
+-----------------------------------------------------------------------------------+
| JS Runtime (Hermes ์์ง: ์ด๊ณ ์ ๊ธฐ๋ ์๋, ๋ฐ์ดํธ์ฝ๋ ์ฌ์ ์ปดํ์ผ) |
+-----------------------------------------+-----------------------------------------+
โ
โผ (JSI: C++ ํฌ์ธํฐ ์ง์ ํธ์ถ, 0์ด ์ง์ฐ)
+-----------------------------------------------------------------------------------+
| - Fabric Renderer : ๋๊ธฐ/๋น๋๊ธฐ ๋ค์ดํฐ๋ธ UI ๋ ๋๋ง, ์ ์ค์ฒ ์๋ต ์ง์ฐ ์ ๋ก |
| - TurboModules : ๋ค์ดํฐ๋ธ ๋ชจ๋ ์ง์ฐ ๋ก๋ฉ (ํ์ํ ์๊ฐ์๋ง ๋ฉ๋ชจ๋ฆฌ ๋ก๋) |
+-----------------------------------------+-----------------------------------------+
โ
โผ
+-----------------------------------------------------------------------------------+
| Native OS ํ๋ซํผ (UIKit / Android View ์ปดํฌ๋ํธ) |
+-----------------------------------------------------------------------------------+
3. [์ด๋ณด์ 1๋จ๊ณ] ํ๋ก์ ํธ ์์ฑ ๋ฐ ๊ฐ๋ฐ ํ๊ฒฝ ๊ตฌ๋
โ ํ๋ก์ ํธ ์ค์บํด๋ฉ ๋ฐ Metro ๋ฒ๋ค๋ฌ ๊ธฐ๋
# 1. TypeScript ํ
ํ๋ฆฟ ๊ธฐ๋ฐ Expo ํ๋ก์ ํธ ์์ฑ
npx create-expo-app@latest my-mobile-app --template default
cd my-mobile-app
# 2. ๋ก์ปฌ ๊ฐ๋ฐ ์๋ฒ(Metro Bundler) ๊ธฐ๋
npx expo start
# 3. ํฐ๋ฏธ๋ ์ธํฐ๋ํฐ๋ธ ํค๋ณด๋ ๋จ์ถํค
# [a] ๋๋ฅด๋ฉด Android ์๋ฎฌ๋ ์ดํฐ ์๋ ์คํ
# [i] ๋๋ฅด๋ฉด iOS ์๋ฎฌ๋ ์ดํฐ ์๋ ์คํ (macOS ์ ์ฉ)
# [r] ๋๋ฅด๋ฉด ๋ฒ๋ค๋ฌ ์บ์ ๋ฆฌ๋ก๋
# ์นด๋ฉ๋ผ๋ก ํฐ๋ฏธ๋์ QR ์ฝ๋๋ฅผ ์ค์บํ๋ฉด ์ค์ ์ค๋งํธํฐ(Expo Go)์์ ์ฆ์ ์คํ!
4. [2๋จ๊ณ] ํต์ฌ UI ์ปดํฌ๋ํธ & Flexbox ์คํ์ผ๋ง
์น๊ณผ ๋ฌ๋ฆฌ <div>๋ <span> ๋์ ํ๋ซํผ ๋ค์ดํฐ๋ธ ์ปดํฌ๋ํธ๋ฅผ ์ฌ์ฉํ๋ฉฐ, ๊ธฐ๋ณธ flexDirection์ **์ธ๋ก(column)**์
๋๋ค.
์์ ํ ํ๋ฉด ์ปดํฌ๋ํธ ์์ (App.tsx)
import React, { useState } from 'react';
import {
StyleSheet,
Text,
View,
SafeAreaView,
Pressable,
FlatList,
StatusBar,
Alert,
} from 'react-native';
interface Item {
id: string;
title: string;
category: string;
}
const DUMMY_DATA: Item[] = [
{ id: '1', title: 'React Native ๋ด ์ํคํ
์ฒ', category: 'Mobile' },
{ id: '2', title: 'Expo Router v3 ํ์ผ ๋ผ์ฐํ
', category: 'Navigation' },
{ id: '3', title: 'Hermes ๋ฐ์ดํธ์ฝ๋ ์ต์ ํ', category: 'Performance' },
];
export default function App() {
const [selectedId, setSelectedId] = useState<string | null>(null);
const handlePress = (item: Item) => {
setSelectedId(item.id);
Alert.alert('์ ํ ์๋ฃ', `"${item.title}" ํญ๋ชฉ์ ์ ํํ์ต๋๋ค.`);
};
return (
<SafeAreaView style={styles.container}>
<StatusBar barStyle="dark-content" />
<View style={styles.header}>
<Text style={styles.headerTitle}>๋ญํคํ
ํฌ ๋ชจ๋ฐ์ผ ์คํ๋์ค</Text>
<Text style={styles.headerSubtitle}>ํฌ๋ก์คํ๋ซํผ ์์ง๋์ด๋ง ์นํธ์ํธ</Text>
</View>
<FlatList
data={DUMMY_DATA}
keyExtractor={(item) => item.id}
contentContainerStyle={styles.listContainer}
renderItem={({ item }) => {
const isSelected = item.id === selectedId;
return (
<Pressable
style={({ pressed }) => [
styles.card,
isSelected && styles.cardSelected,
pressed && styles.cardPressed,
]}
onPress={() => handlePress(item)}
>
<Text style={styles.cardCategory}>{item.category}</Text>
<Text style={styles.cardTitle}>{item.title}</Text>
</Pressable>
);
}}
/>
</SafeAreaView>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#f8fafc',
},
header: {
padding: 20,
backgroundColor: '#ffffff',
borderBottomWidth: 1,
borderBottomColor: '#e2e8f0',
},
headerTitle: {
fontSize: 22,
fontWeight: '700',
color: '#0f172a',
},
headerSubtitle: {
fontSize: 14,
color: '#64748b',
marginTop: 4,
},
listContainer: {
padding: 16,
gap: 12,
},
card: {
backgroundColor: '#ffffff',
padding: 16,
borderRadius: 12,
borderWidth: 1,
borderColor: '#e2e8f0',
shadowColor: '#000000',
shadowOffset: { width: 0, height: 2 },
shadowOpacity: 0.05,
shadowRadius: 4,
elevation: 2, // Android ์ ์ฉ ๊ทธ๋ฆผ์ ์์ฑ
},
cardSelected: {
borderColor: '#10b981',
backgroundColor: '#ecfdf5',
},
cardPressed: {
opacity: 0.8,
transform: [{ scale: 0.98 }],
},
cardCategory: {
fontSize: 12,
fontWeight: '600',
color: '#10b981',
textTransform: 'uppercase',
},
cardTitle: {
fontSize: 16,
fontWeight: '600',
color: '#1e293b',
marginTop: 4,
},
});
6. [4๋จ๊ณ] ๋ค์ดํฐ๋ธ ํ๋์จ์ด API & ๋ก์ปฌ ์คํ ๋ฆฌ์ง ์ฐ๋
โ ๋น๋๊ธฐ ์๊ตฌ ์ ์ฅ์ (AsyncStorage)
npx expo install @react-native-async-storage/async-storage
import AsyncStorage from '@react-native-async-storage/async-storage';
// ๋ฐ์ดํฐ ์๊ตฌ ์ ์ฅ
export const saveUserToken = async (token: string) => {
try {
await AsyncStorage.setItem('@auth_token', token);
} catch (e) {
console.error('์คํ ๋ฆฌ์ง ์ ์ฅ ์คํจ', e);
}
};
// ๋ฐ์ดํฐ ์กฐํ
export const getUserToken = async (): Promise<string | null> => {
try {
return await AsyncStorage.getItem('@auth_token');
} catch (e) {
return null;
}
};
โก ๋ค์ดํฐ๋ธ ์นด๋ฉ๋ผ & ์์น ์ผ์ ์ ๊ทผ
npx expo install expo-camera expo-location
import * as Location from 'expo-location';
export const getCurrentGPS = async () => {
// 1. ๋ค์ดํฐ๋ธ ๊ถํ ์์ฒญ ํ์
const { status } = await Location.requestForegroundPermissionsAsync();
if (status !== 'granted') {
throw new Error('์์น ์ ๊ทผ ๊ถํ์ด ๊ฑฐ๋ถ๋์์ต๋๋ค.');
}
// 2. ํ์ฌ ์ขํ ํ๋
const location = await Location.getCurrentPositionAsync({});
return {
latitude: location.coords.latitude,
longitude: location.coords.longitude,
};
};
7. ํ๋ก๋์ ๋น๋ & EAS ๋ฐฐํฌ ์ฒดํฌ๋ฆฌ์คํธ
๐ EAS (Expo Application Services) ํด๋ผ์ฐ๋ ๋น๋ ํ์ดํ๋ผ์ธ
Mac ์ปดํจํฐ๊ฐ ์์ด๋ ํด๋ผ์ฐ๋ ์๋ฒ์์ iOS .ipa ๋ฐ Android .aab ํ์ผ์ ์๋ ๋น๋ํฉ๋๋ค.
# 1. EAS CLI ์ค์น ๋ฐ ๋ก๊ทธ์ธ
npm install -g eas-cli
eas login
# 2. ํ๋ก์ ํธ ์ด๊ธฐํ (eas.json ์์ฑ)
eas build:configure
# 3. Android ๊ตฌ๊ธ ํ๋ ์ด์ฉ AAB ๋น๋
eas build --platform android --profile production
# 4. iOS ์ฑ์คํ ์ด์ฉ ๋น๋ (Apple ๊ฐ๋ฐ์ ๊ณ์ ์ธ์ฆ์ ์๋ ์์ฑ)
eas build --platform ios --profile production
๐ ๏ธ ํ๋ก๋์ ์ฑ๋ฅ ์ต์ ํ ํต์ฌ ์์น
- FlatList ์ต์ ํ (๋ฉ๋ชจ๋ฆฌ ๋ฆญ ๋ฐฉ์ง):
renderItemํจ์์ ์ด๋ฒคํธ ํธ๋ค๋ฌ๋ฅผ ๋ฐ๋์useCallback์ผ๋ก ๊ฐ์ธ ๋ถํ์ํ ๋ฆฌ๋ ๋๋ง ์ฐจ๋จ.- ๊ณ ์ ๋์ด ์์ดํ
์ธ ๊ฒฝ์ฐ
getItemLayout์ ์ ์ธํ์ฌ ๋ ์ด์์ ์ฐ์ฐ ๋น์ฉ์ 0์ผ๋ก ๋จ์ถ.
- Hermes ์์ง ํ์ฑํ ํ์ธ:
app.json์"jsEngine": "hermes"์ค์ ํ์ (์ฑ ๊ธฐ๋ ์๋ ์ต๋ 2๋ฐฐ ๊ฐ์, APK ์ฉ๋ ๋ํญ ๊ฐ์).
- ์ฝ์ ๋ก๊ทธ ํ๋ก๋์
์ ๊ฑฐ:
babel-plugin-transform-remove-consoleํ๋ฌ๊ทธ์ธ์ ์ ์ฉํ์ฌ ๋ฆด๋ฆฌ์ฆ ๋น๋ ์ ๋ชจ๋console.log์๋ ์ ๊ฑฐ (JS ์ค๋ ๋ ๋ธ๋กํน ๋ฐฉ์ง).
์๊ฒฌ ๋ฐ ์ง๋ฌธ
0์์ง ๋ฑ๋ก๋ ์๊ฒฌ์ด ์์ต๋๋ค. ์ฒซ ๋ฒ์งธ ๋๊ธ์ ๋จ๊ฒจ๋ณด์ธ์!
๋๊ธ ์์
๋๊ธ ์ญ์