React Native enables you to write Android and iOS apps using JavaScript. It uses React’s virtual DOM concept to manipulate native platform UI components, providing a familiar experience to users.
iOS apps can only be built on macOS, so we’ll start our tutorial by demonstrating how to install React Native on a Mac.
We will cover:
Installing Homebrew, NodeJs, Watchman
Installing Xcode and Xcode Command Line Tools
Ruby and Gem with FFI and COCOAPODS dependencies
Creating sample react native project
Installing Visual Studio Code (IDE)
Installing Homebrew
https://brew.sh
installing NodeJs, Watchman
brew install node
brew install watchman
Xcode
The easiest way to install Xcode is via the Mac App Store. Installing Xcode will also install the iOS Simulator and all the necessary tools to build your iOS app.
If you have already installed Xcode on your system, make sure it is version 10 or newer.
Command Line Tools
You will also need to install the Xcode Command Line Tools. Open Xcode, then choose "Preferences..." from the Xcode menu. Go to the Locations panel and install the tools by selecting the most recent version in the Command Line Tools dropdown
Installing an iOS Simulator in Xcode
To install a simulator, open Xcode , Preferences... and select the Components tab. Select a simulator with the corresponding version of iOS you wish to use.
CocoaPods
CocoaPods is built with Ruby and it will be installable with the default Ruby available on macOS. You can use a Ruby Version manager, however we recommend that you use the standard Ruby available on macOS unless you know what you're doing.
Using the default Ruby install will require you to use sudo when installing gems. (This is only an issue for the duration of the gem installation, though.)
Creating a new application
npx react-native init AwesomeProject