Getting start with React Native

React Native lets us build mobile app using only JavaScript. It uses the same designs as React, letting us compose a rich mobile UI from declarative components.

I am writing this article based on those experiences which I got trouble while install in all working OS like Windows, Mac, and Linux.

Initially I have started working on Mac mini which have install macOS High Sierra OS, then after few month I have been shifted towards Linux OS after struggle getting speed up work in Ubuntu 14.1 again I switch over new OS which is Windows so that’s how finally I got windows 10  to set up my React Native projects.

Some of those might asked which is the best OS or platform for react native, I would personally experience and got the best is Mac OS, it’s simply because it’s easy to setup X code for I-OS development and Android Studio for Android development in that, apart from this in Linux or Windows you build react native projects which for android development but we need to export(build) that project and execute(run) on Mac system to check whether it’s perfectly fine.

So basically we need to do more efforts and trouble while implement react native projects in Windows system and Linux system.

Installation (Mac, Windows and Linux)

System Requirement :

For emulator minimum 6 GB RAM


Software
Version
Android studio (IDE)
3.0.0
Android Sdk
28.0.0
Java
1.8.0_171
Node Js
8.11.2
NPM
5.6.0
React native cli
2.0.1

You will need Node, the React Native command line interface, Python2, a JDK, and Android Studio.

Node for







Node check in Command Prompt :

Make sure that you have open Command Prompt with Run as Administrator.




While you can use any editor of your choice to develop your app, you will need to install Android Studio in order to set up the necessary tooling to build your React Native app for Android.

Install Android Studio:


  • Choose a "Custom" setup when prompted to select an installation type. Make sure the boxes next to all of the following are checked:

o    Android SDK

  • Then, click "Next" to install all of these components.
  • Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.
Install the Android SDK:
  • Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the Android 6.0 (Marshmallow) SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.
  • The SDK Manager can be accessed from the "Welcome to Android Studio" screen. Click on "Configure", and then select "SDK Manager".




Select the "SDK Platforms" tab from within the SDK Manager, then check the box next to "Show Package Details" in the bottom right corner. Look for and expand the Android 6.0 (Marshmallow) entry, then make sure the following items are all checked:
  •  Google APIs
  • Android SDK Platform 23
  • Intel x86 Atom_64 System Image
  • Google APIs Intel x86 Atom_64 System Image


Next, select the "SDK Tools" tab 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 23.0.1 is selected.




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

Configure the ANDROID_HOME environment variable :

The React Native tools require some environment variables to be set up in order to build apps with native code.

Open the System pane under System and Security in the Windows Control Panel, then click on Change settings.... Open the Advanced tab and click on Environment Variables.... Click on New... to create a new ANDROID_HOME user variable that points to the path to your Android SDK:





The SDK is installed, by default, at the following location:

c:\Users\YOUR_USERNAME\AppData\Local\Android\Sdk

There are several for editors which you can try with like :
And the list goes on but I would suggest you to go atom or visual code, because react native extensions and libraries need to install that is what editors are helping you to create react native apps.

After finished up with Node, Editor and Android Studio or XCode lets start with React Native.

Installing dependencies for Windows OS :

Node, Python2, JDK

We recommend installing Node and Python2 via Chocolatey , a popular package manager for Windows. React Native also requires a recent version of the Java SE Development Kit (JDK), as well as Python 2.

Both can be installed using Chocolatey.

Open an Administrator Command Prompt (right click Command Prompt and select "Run as Administrator"), then run the following command:


choco install -y nodejs.install python2 jdk8
If you have already installed Node on your system, make sure it is Node 8 or newer. If you already have a JDK on your system, make sure it is version 8 or newer.

Installing dependencies for Mac OS:

Node, Watchman
We recommend installing Node and Watchman using Homebrew. Run the following commands in a Terminal after installing Homebrew:
http://brew.sh/

Enter this command in Terminal :


/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"


brew install node
brew install watchman

The React Native CLI  :

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

Run the following command in a Command Prompt or shell (Run as Administrator):


npm install -g react-native-cli

Running your React Native application :

Run react-native run-android inside your React Native project folder print this commands using Terminal or Command Prompt:


cd MyFirstRN
react-native run-android

Modifying your app

Now that you have successfully run the app, let's modify it. Open App.js in your text editor of choice and edit some lines. Press the R key twice or select Reload from the Developer Menu (Ctrl + M) to see your changes!




Conclusion:

This is how we can setup and getting start with react native.

I hope you like this article.

Please share your feedback.

Comments

Popular Posts

Contact Application Using ASP.NET Core Web API, Angular 6.0, And Visual Studio Code - Part One

Contact Application Using ASP.NET Core Web API, Angular 6.0, And Visual Studio Code - Part Two

Send an Email Reminder Notification Based on an Expiration Date using Power Automate

MySQL Data Access API Development Using Express.JS, Node.JS

Chat Application using Angular 8, Asp.net Core 2.2.0, Signal R 1.1.0

ReactNative FlatList

Getting Start With Data Analysis Using SSAS Tabular Modeling In Excel - Part Two

Contact application - Upgrade Asp.net Core 2.0 to 2.1

Send Email With SharePoint Lookup Columns Data Using Power Automate

Typescript Basics