Web Programming TutorialsInstalling and Setting up React Native Environment

Installing and Setting up React Native Environment

react-native

React was introduced by Facebook in 2013 as a declarative JavaScript library to help accentuate the features of JavaScript and simplify coding. What React does is renders just the right components when data changes, speeding up the process of reloading the page every time.

A further addition was made to this amazing library, known as React Native. React was already making waves on the market, but these apps were only good for JavaScript, as React was written in JavaScript. This created a huge gap that needed to be filled. The apps created in React could not run on certain platforms, including iOS.

React Native shifted focus from browsers to tap the smartphone market by helping developers bridge the gap between React and the host-platforms. React Native allows developers to write apps in JavaScript that render natively on the host platform.

In this blog, you will learn how to get started with React Native, including how to download the package, install it and set up the environment. This is a great sneak peek into Eduonix’s upcoming React Native Course on Indiegogo.

Let’s get started with downloading and setting up React Native.

In order to install React Native, you will need Node.js, the React Native command line interface, and Android Studio.

We suggest that you install Node.js and Python2 via Chocolatey, a popular package manager similar to yum, then run the following command.

choco install nodejs.install choco install python2

You can find additional installation options on Node.js’s Downloads Page.

Node.js comes with npm, which lets you install the React Native command line interface.

1. Download and install Android Studio

Android Studio provides the Android SDK and AVD (emulator) required to run and test your React Native apps.

2. Install the AVD and HAXM

Choose Custom installation when running Android Studio for the first time. Make sure the boxes next to all of the following are checked:

  • Android SDK
  • Android SDK Platform
  • Performance (Intel HAXM)
  • Android Virtual Device

Then, click “Next” to install all of these components.

3. Install the Android 6.0 (Marshmallow) SDK

Android Studio installs the most recent Android SDK by default. React Native, however, requires the Android 6.0 (Marshmallow) SDK. To install it, launch the SDK Manager, click on “Configure” in the “Welcome to Android Studio” screen.

The SDK Manager can also be found within the Android Studio “Preferences” menu, under Appearance & Behavior → System Settings → Android SDK. Select “SDK Platforms” from within the SDK Manager, then check the box next to “Show Package Details”. Look for and expand the Android 6.0 (Marshmallow) entry, then make sure the
following items are all checked:

  • Google APIs
  • Intel x86 Atom System Image
  • Intel x86 Atom_64 System Image
  • Google APIs Intel x86 Atom_64 System Image

Next, select “SDK Tools” and check the box next to “Show Package Details” here as well. Look for and expand the “Android SDK Build Tools” entry, then make sure that Android SDK Build-Tools 23.0.1 is selected.

Finally, click “Apply” to download and install the Android SDK and related build tools.

4. Set up the ANDROID_HOME environment variable

The React Native command line interface requires the ANDROID_HOME environment variable to be set up.

Go to Control Panel → System and Security → System → Change settings → Advanced System Settings → Environment variables → New, then enter the path to your Android SDK.
android_home
Restart the Command Prompt to apply the new environment variable.

Please make sure you export the correct path for ANDROID_HOME, if you did not install the Android SDK using Android Studio.

If you want to learn more about React Native and also how to building brilliant applications with this amazing, you can help support Eduonix’s React Native course on Indiegogo!

2 COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Exclusive content

- Advertisement -

Latest article

21,501FansLike
4,106FollowersFollow
106,000SubscribersSubscribe

More article

- Advertisement -