![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKEzEX6Wn-wYPkrdVHVdiRQGVyTlK12hovIDdOtFnVWvbxu5os6FWy0H4rc1tHGmjZg-Q33VDqVimaTCCszBiP6dtwiDXOlQhyphenhyphenfArccYzkPIqRow9S_fFa5lW1SyJaOExp2syNnE_C0eJB/s16000-rw/photo_2021-01-26_21-15-35.jpg)
Hello Readers, In this post I will talk about how you can set-up react-native environment into your computer.
We need some tools for setup React-Native. here is list of all tools:
- Java Development Kit (JDK8 or higher)
- Node.js
- Node Package Manager
- React Native CLI
- Android Studio
- Android Emulator or Real Device
- Visual Studio Code or Other IDE
Step 1: (Installation of JDK)
- You can download jdk from it's official site & install it on computer
- Download JDK
- When your jdk is installed successfully on the computer you need to verify.
- open Command Prompt and type
java -version
&javac -version
- if you get java version then all-is-well otherwise we need to configure the environment variable for jdk.
Step 2: (Installation of Node.js)
- Download Node.js Package from official site & install it on computer
- When you install Node.js, NPM is installed automatically with it.
- Download Node.js
- After your Node.js is installed successfully verify your node version & npm version
- open Command Prompt and type
node -v
&npm -v
Step 3: (Installation of React-Native CLI)
- You can install react-native cli in your computer globally using the below command:
npm install -g react-native-cli
- after installation, you can verify using
react-native -v
.
Step 4: (Installation of Android Studio)
- Download Android Studio from the below link & install it
- Download Android-Studio
- Android Studio installs the latest SDK by default, if you want to change your SDK then follow the below steps:
- open SDK manager, now you can select your desire SDK (make sure React-Native support minimum Android 6.0 SDK so you need to choose any of the above)
- after selection click on apply button right-side bottom.
- also, you need to install the "Google Play Licensing Library" from SDK Tools.
- after that setup the environment variable "ANDROID_HOME" as per your SDK location.[ Where to setup : click window button & type environment variable, click on new to create variable ]
Step 5: (Setup Android Emulator)
- Open Android Studio & click on AVD Manager.
- Create a new Virtual device, Setup your desire phone model and android version.
- after the successfully created virtual device click on the play button to launch the emulator.
Thank God!!!! finally, react-native installed on the computer. now we need to install IDE for development react-native project.
Step 6: (Installation of Visual Studio Code)
- Visual Studio Code is one of my favorite IDE for coding. so, I preferred to use VS Code.
- also, you can use different snippets with VS Code to make easy coding.
- Download VS Code
That's all. now you can say we complete the full installation of react-native-cli and we can now create our first project in react-native.
Create React-Native Project:
- open Command Prompt and go to your desire folder or directory using cd command.
- then type the below command to create a project.
react-native init your_project_name
That's it. now we run our first project. make sure you have launched the emulator already or connected with a USB debugging enabled device.
Run React-Native Project:
- open the command prompt and navigate to your project root directory.
- after that type
react-native start
. - then open a separate command prompt window & navigate to the project root directory.
- after that type
react-native run-android
.
Horray!!! that's all, I hope you have enjoyed your reading and now you can able to make your dream application with react-native. let me know if you have any doubts about the above article.
Thank you guys for making my day.
إرسال تعليق