React Native is a platform-agnostic JavaScript Library for creating native applications on mobile and desktop platforms. It lets you build UI with React, a popular JavaScript library. But building apps for multiple operating systems means using different versions of Node JS. So in this post, I will be guiding you threw very easy ways to get ready for your first react native app.
Dependency Required For React Native Development
First, we need to install dependencies on which the react native development majorly depends these are Node.js, Java jdk, and android studio.
Installing Dependencies To Your System
Node Js
A stable version can be downloaded from the Node.js official website and installed on Windows, similar to other applications.
Note: To check you have installed the node successfully in your machine open your terminal and run the command “ node -v “which will give the node version you have installed.
Jdk
JDK 8 or above can be downloaded from the official website of Oracle and installed by following the simple on-screen instructions.
Note: use jdk 8 for error free environment
After installing jdk check if your path variable is set up correctly or not, if not set it up manually.
Go to the windows search panel and search for advanced system settings.
Open it and click the Environment variable.
New in system variable click path and edit it.
paste your file location of jdk into it and save your changes.
Note: To check your jdk is installed and the path variable is set correctly run the command “ javac -version “which will give you the javac version.
Android Studio
Android Studio can be downloaded and installed from its official website. During the installation process, the option to use an emulator with the system can be checked.
The path variable for the android SDK and platform tools can be set by opening Android Studio, going to the SDK Manager tab, copying the SDK location and pasting it into the environment variable's system variable and path.
To set the path variable for android platform tools, the SDK tools tab in the SDK Manager should be checked for the android sdk tool, SDK platform tool, and SDK builds tool. Then, the path at C:\Users\name\AppData\Local\Android\Sdk\platform-tool should be copied, a new path created in the environment variable, and pasted there.
The ANDROID_HOME variable can be set by copying the android sdk path location, going to the environment variable, creating a new user variable named ANDROID_HOME and pasting the SDK path.
To ensure the setup is completed, a mobile device can be connected using a USB cable and the command ~ adb devices should list the device.
React Native CLI
React Native CLI can now be started by following the recent React Native documentation and not installing it, but by using npx. This can be done by running the command "npx react-native init MyFirstApp", followed by navigating to the folder and starting the React Native server using "npx react-native start". An Android build can also be started using "npx react-native run-android", after which the development environment will be ready for React Native.
Hope you guys like it. If you got any help from this article do comment, like and share it. Thanks and Happy Coding!😊!