DEV Community

Cover image for Setting Up a React Native Expo Project with Yarn
Priyanxhu
Priyanxhu

Posted on

Setting Up a React Native Expo Project with Yarn

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

  1. Install Expo CLI globally using Yarn:
yarn global add expo-cli
Enter fullscreen mode Exit fullscreen mode
  1. Create a new Expo project:
expo init my-expo-app
Enter fullscreen mode Exit fullscreen mode
  1. Navigate to project directory:
cd my-expo-app
Enter fullscreen mode Exit fullscreen mode
  1. Install dependencies with Yarn:
yarn install
Enter fullscreen mode Exit fullscreen mode

Running the Project

Start the development server:

yarn start
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

Tips

  • Use yarn.lock for consistent dependencies
  • Keep Expo SDK updated
  • Check app.json for configuration

Happy coding! 🚀

Top comments (0)