첫 Expo 프로젝트 만들기
`npx create-expo-app`을 사용해 새 프로젝트의 기본 골격을 만들고, 생성된 파일을 살펴보며 React Native 애플리케이션의 진입점을 이해합니다.
첫 Expo 프로젝트 만들기은(는) CoddyKit의 무료 React Native Academy 강의입니다. 이것은 4개 중 2번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 React Native Academy 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. React Native Academy 강의에는 총 4개의 강의가 포함되어 있습니다.
이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.
The create-expo-app Command
The easiest start is npx create-expo-app MyApp. It grabs the latest template, sets up folders, and installs everything. Add a template flag to start blank or with navigation.
# Create a new Expo project
npx create-expo-app MyFirstApp
# Create with a blank TypeScript template
npx create-expo-app MyFirstApp --template blank-typescript
# Create with tabs navigation template
npx create-expo-app MyFirstApp --template tabs
# Move into the project
cd MyFirstAppGenerated Folder Structure Overview
Get to know your new folders. App.js is the entry point React renders first, app.json holds your config, and assets/ stores images and fonts. The code maps it all out.
MyFirstApp/
├── App.js # Root component (entry point)
├── app.json # Expo configuration
├── package.json # NPM dependencies & scripts
├── babel.config.js # Babel transpiler config
├── assets/ # Images, fonts, icons
│ ├── icon.png
│ ├── splash.png
│ └── adaptive-icon.png
└── node_modules/ # Installed packagesThe app.json Configuration File
app.json is your project's config hub — app name, version, icons, splash screen, and per-platform settings for iOS and Android. Changing it needs a rebuild, not a hot reload.
{
'expo': {
'name': 'My First App',
'slug': 'my-first-app',
'version': '1.0.0',
'orientation': 'portrait',
'icon': './assets/icon.png',
'splash': {
'image': './assets/splash.png',
'resizeMode': 'contain',
'backgroundColor': '#ffffff'
},
'ios': {
'bundleIdentifier': 'com.yourname.myfirstapp'
},
'android': {
'package': 'com.yourname.myfirstapp'
}
}
}The package.json and Scripts
package.json lists your dependencies and scripts. The defaults — start, ios, android, web — launch your app in different places. You can add your own scripts too.
// package.json (excerpt)
{
'name': 'my-first-app',
'version': '1.0.0',
'main': 'node_modules/expo/AppEntry.js',
'scripts': {
'start': 'expo start',
'android': 'expo start --android',
'ios': 'expo start --ios',
'web': 'expo start --web'
},
'dependencies': {
'expo': '~50.0.0',
'react': '18.2.0',
'react-native': '0.73.x'
}
}Understanding App.js — The Root Component
App.js exports the root component React Native renders first — every other component lives inside it. It's the first file you'll edit, like index.html in a web project.
import { StatusBar } from 'expo-status-bar';
import { StyleSheet, Text, View } from 'react-native';
export default function App() {
return (
<View style={styles.container}>
<Text>Open up App.js to start working!</Text>
<StatusBar style='auto' />
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});JSX: Describing UI in JavaScript
JSX lets you write HTML-like markup inside JavaScript to describe your UI. It's not HTML though — use style instead of class, onPress instead of onclick. The code shows it.
import { View, Text } from 'react-native';
const name = 'World';
const count = 42;
export default function App() {
return (
<View>
{/* This is a JSX comment */}
<Text>Hello, {name}!</Text>
<Text>You have {count} messages.</Text>
{count > 0 && <Text>You have unread items.</Text>}
</View>
);
}Babel and Transpilation
Expo uses Babel to translate modern JavaScript and JSX into code each platform can run. You rarely touch its config — mainly to add handy path aliases like @/components.
// babel.config.js (default Expo config)
module.exports = function(api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
plugins: [
// Example: add module resolver for clean imports
[
'module-resolver',
{
root: ['./'],
alias: {
'@components': './components',
'@screens': './screens',
},
},
],
],
};
};Installing Additional Dependencies
To add packages, prefer npx expo install over npm install — it picks the version that matches your Expo SDK, avoiding subtle mismatch bugs. Plain npm is fine for pure-JS packages.
# Use expo install for SDK-compatible packages
npx expo install expo-camera expo-location
npx expo install react-native-maps
# Use npm install for pure JS packages
npm install lodash date-fns
# Check for outdated Expo SDK packages
npx expo install --check
# Fix version mismatches
npx expo install --fixMaking Your First Code Change
Open App.js, change the text, and save — Fast Refresh updates your app in under a second while keeping its state. Try tweaking a color to see instant feedback. ✨
// Modified App.js
import { StyleSheet, Text, View } from 'react-native';
export default function App() {
return (
<View style={styles.container}>
<Text style={styles.title}>Hello, React Native!</Text>
<Text style={styles.subtitle}>I made my first change.</Text>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#f0f4ff',
alignItems: 'center',
justifyContent: 'center',
},
title: { fontSize: 24, fontWeight: 'bold', color: '#333' },
subtitle: { fontSize: 16, color: '#666', marginTop: 8 },
});The Expo SDK and Managed Workflow
The Expo SDK gives you ready-made modules for camera, location, sensors, and more. In the managed workflow Expo handles native code for you — simpler, but limited to SDK APIs.
// Example: using Expo SDK modules
import * as Battery from 'expo-battery';
import * as Haptics from 'expo-haptics';
async function checkBattery() {
const level = await Battery.getBatteryLevelAsync();
console.log('Battery level:', level); // 0.0 - 1.0
}
async function vibrate() {
await Haptics.notificationAsync(
Haptics.NotificationFeedbackType.Success
);
}TypeScript Support in Expo
Expo has first-class TypeScript support. Start with the blank-typescript template, or rename App.js to App.tsx. TypeScript catches type errors early and sharpens autocomplete.
// App.tsx with TypeScript
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
interface Props {
greeting?: string;
}
export default function App({ greeting = 'Hello' }: Props) {
const message: string = greeting + ', TypeScript!';
return (
<View style={styles.container}>
<Text>{message}</Text>
</View>
);
}
const styles = StyleSheet.create({
container: { flex: 1, alignItems: 'center', justifyContent: 'center' },
});Quick Check
Test your understanding of React Native Mobile Development concepts from this lesson.
Lesson Recap
You scaffolded your first app: create-expo-app builds a full project instantly, app.json controls its settings, and Fast Refresh shows edits live. Next: running on devices! 🚀
자주 묻는 질문
“첫 Expo 프로젝트 만들기” 강의는 무료인가요?
네 — “첫 Expo 프로젝트 만들기” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 React Native Academy 강의 전체를 잠금 해제할 수 있습니다. React Native Academy 강의에는 총 4개의 강의가 포함되어 있습니다.
“첫 Expo 프로젝트 만들기”에서 뭘 배우나요?
`npx create-expo-app`을 사용해 새 프로젝트의 기본 골격을 만들고, 생성된 파일을 살펴보며 React Native 애플리케이션의 진입점을 이해합니다. 브라우저에서 직접 실행하는 실습 코드로 React Native Academy을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.
React Native Academy을(를) 시작하는 데 경험이 필요한가요?
사전 경험은 필요하지 않습니다. CoddyKit의 React Native Academy은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 2번째 강의입니다.
“첫 Expo 프로젝트 만들기” 강의는 얼마나 걸리나요?
대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.
이 React Native Academy 강의에서 코드를 작성하고 실행할 수 있나요?
네. 모든 React Native Academy 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.
이 강의의 모든 강의
- Node, Expo CLI 및 시뮬레이터 설치
- 첫 Expo 프로젝트 만들기
- 기기와 에뮬레이터에서 실행하기
- 프로젝트 구조 이해하기