Introduction
In this blog, we will be exploring the demonstration of building iOS apps using React Native.
React Native enables the user to encrypt Android and iOS apps using JavaScript. It specializes in React’s virtual DOM concept to manipulate native platform UI components, providing a perfect experience to users.
There are two ways to build iOS apps:
- React Native CLI is more complex but gives users more control over their app. It can only be made on macOS.
- Expo: It is easy to set up but has a bigger footprint. It is applicable on all desktop platforms.
In this blog, we will discuss both methods.
Also See, Hooks in React JS and React Native Reanimated
Environment Setup
Using React Native on macOS
The React Native CLI is suitable as an npm package.
Before installing it, ensure Xcode is installed on the user's system. This is where we build the native iOS code for React Native to be used. As a first step, install Xcode from the App Store.
We run the following command to create a new Native project.
npx react-native init myproject
We can start the project by running npm run ios. This will initiate the app on the iOS simulator.
Using React Native for Windows/Linux
To install Expo on your system, run the following terminal command:
npm install -g expo-cli
Command to initialize expo repository:
expo init myproject
Command to run the expo app:
expo start
Check out Advantages of React JS here.