You can create a new React Native project using Expo CLI (easier setup) or React Native CLI (more control). Here’s how:
Expo is a framework that simplifies React Native development by handling configurations.
Make sure you have Node.js installed. You can check by running:
node -v
npm -v
If not installed, download it from nodejs.org.
Run the following command to install Expo CLI globally:
npm install -g expo-cli
Run:
npx create-expo-app MyNewApp
Replace MyNewApp with your project name.
cd MyNewApp
npm start
or
expo start
This will open the Expo Developer Tools in your browser. You can scan the QR code using the Expo Go app on your phone to run the app.
If you need more control (e.g., native modules, deeper customization), use React Native CLI.
brew install watchman
You don't need to install it globally. Just use:
npx react-native init MyNewApp
cd MyNewApp
For Android:
npx react-native run-android
For iOS (Mac + Xcode required):
npx react-native run-ios
Note: You need to have Android Studio (for Android) or Xcode (for iOS) set up properly.