Learn how to create and set up a React Native project using Expo and Yarn package manager
Setting Up a React Native Expo Project with Yarn
Prerequisites
- Node.js installed
- Yarn package manager installed
- Expo CLI
Installation Steps
- Install Expo CLI globally using Yarn:
yarn global add expo-cli
- Create a new Expo project:
expo init my-expo-app
- Navigate to project directory:
cd my-expo-app
- Install dependencies with Yarn:
yarn install
Running the Project
Start the development server:
yarn start
Common Scripts
-
yarn start
: Starts the development server -
yarn android
: Runs app on Android emulator -
yarn ios
: Runs app on iOS simulator -
yarn web
: Runs app in web browser -
yarn test
: Runs tests -
yarn eject
: Ejects from Expo
Additional Dependencies
To add new packages:
yarn add package-name
Tips
- Use
yarn.lock
for consistent dependencies - Keep Expo SDK updated
- Check
app.json
for configuration
Happy coding! 🚀
Top comments (0)