Table of Contents
Install expo-cli package:
Please note that in order to work with React Native, NodeJS must be installed on your system. If you have not yet installed NodeJS, please do so before proceeding with React Native.
Install NodeJS on Windows or Ubuntu, MacOS
To create a new React Native project, it is necessary to have the expo-cli package installed globally. You can install the package using the following command:
$ npm install -g expo-cli
Create new react native application
Use following command to create React Native application
$ npx create-expo-app HelloReactNative
$ cd HelloReactNative
$ npm install
Start/run React Native application
$ npm start # or you can also use: npx expo start
Running your React Native application on ISO/iPhone
Before running the application on your iOS device, you must first install the Expo Go Mobile application on your iPhone. You can download and install the Expo application from the App Store.
Once you have installed the Expo Go application, it may prompt you for several permissions. Please ensure to provide the necessary permissions to the application.
Assuming you have already started your HelloReactNative
application using the npm start
command, please make sure that it is still running. If it is not running, please run the command again to start the application.
After executing the command, a QR code should be visible in the output.
Use the camera app on your iPhone to scan the QR code and open the React Native application on your device.
Congratulations, you have successfully launched the React Native application on your device.