Getting Started with React Native
Setting Up Your Development Environment
React Native is a popular framework for building mobile applications using JavaScript and React. This guide will walk you through setting up your development environment and creating your first React Native app.
Prerequisites
-
Install Node.js: Download and install Node.js from nodejs.org
-
Install Watchman (for macOS users):
brew install watchman
- Install React Native CLI:
npm install -g react-native-cli
-
Install Xcode (for iOS development on macOS)
- Download from the Mac App Store
- Install iOS Simulator
-
Install Android Studio (for Android development)
- Download from developer.android.com
- Install Android SDK
- Configure Android Emulator
Creating Your First React Native App
- Create a new project:
npx react-native init MyFirstApp
- Navigate to your project:
cd MyFirstApp
- Start Metro bundler:
npx react-native start
- Run on iOS (in a new terminal):
npx react-native run-ios
- Or run on Android:
npx react-native run-android
Next Steps
Congratulations! You've set up your development environment and created your first React Native app. Here are some next steps to continue your learning:
- Explore the React Native documentation
- Learn about components and JSX
- Understand state and props in React
- Experiment with styling in React Native
- Try building a simple app, like a todo list or weather app