How to Start a React Native Application
How to Run iApp or Start a React Native Application
Prerequisite:
These Softwares need to be installed to start any React Native application.
- Node JS - https://nodejs.org/en/
- Java - JDK -
- Link - https://www.oracle.com/java/technologies/javase-jdk15-downloads.html
- Version - Windows x64 Installer - https://www.oracle.com/java/technologies/javase-jdk15-downloads.html#license-lightbox
- Look at the screenshot of download link and file
- Android Studio
- Visual Studio Code (If Code Editor is suggested)
Prerequisite Installation Screenshots:
Install Java JDK
Install Android Studio
Setup Environment Variables
- Go to Environment Variables
- Click Change Environment Variables
- In User Variables, change the things like below
- ANDROID_HOME - C:\Users\akash.corp\AppData\Local\Android\Sdk
- ANDROID_SDK_ROOT - C:\Users\akash.corp\AppData\Local\Android\Sdk
- JAVA_HOME - C:\Program Files\Java\jdk1.8.0_271
- In System Variables, change the things like below
- JAVA_HOME - C:\Program Files\Java\jdk1.8.0_271
- In path, add/check these entries
- C:\Program Files\nodejs\
- C:\Users\akash.corp\AppData\Local\Android\Sdk
- C:\Users\akash.corp\AppData\Local\Android\Sdk\platform-tools
- C:\Program Files\Android\Android Studio\jre
- C:\Program Files\Java\jdk1.8.0_271\bin
- C:\Program Files\Java\jdk1.8.0_271
- Check the screenshots, as everything explained there.
Here, akash.corp is the username. In your case, it would be yours.
You can find these documentation in the React Native Documentation portal.
https://reactnative.dev/docs/environment-setup
Congratulations. Everything is just set upped for you to start a React Native application now.
Start a New React Native Application
Install a new React Native Application.
Instructions are in this documentation - https://reactnative.dev/docs/environment-setup
Let’s start ourselves.
- Create New Project By running this command
npx react-native init AwesomeProject
- A react native project will be created. It’ll take 2-5 minutes. And a Folder named AwesomeProject will be created.
- Go to that folder - cd AwesomeProject
- Now, need to run the project
- Before Running the project ensure the below staffs ready
- Run Android Studio for test in android. Check the screenshot to run in android studio
- Or, Run Xcode for run in Xcode of Mac
- Run Android Studio Emulator or Xcode Emulator
- Run Project By running these command
npx react-native run-android
Or, npx react-native run-ios
Start React Native Application Screenshots:
Run Android Studio and Start Emulator.
After successfully running the emulator, it will open the android emulator.
After successfully installed the project, powershell will be like this -
If error occur like this -
Then open the android project using the android studio and it’ll be fixed then.
Now, again run the project from android studio or by running this command -
npx react-native run-android
Congratulations, we’ve successfully run our React Native Project.
Change App.js and Check App is Working or not
Drag and drop the project to Visual Studio Code and here is the react native project after placing it to Visual Studio Code.
Let’s change app.js and check and look at the screenshot. I think it’s pretty simple.
- First, click app.js.
- Remove unnecessary lines from app.js
- Add a simple title style inside styles variable
- Add a simple text inside Scrollview
- Code is this -
import React from 'react';
import {
StyleSheet,
ScrollView,
Text,
} from 'react-native';
const App = () => {
return (
<>
<ScrollView>
<Text style={ styles.title }>
Welcome to Our First React Native App
</Text>
</ScrollView>
</>
);
};
const styles = StyleSheet.create({
title: {
fontSize: 30,
textAlign: 'center'
}
});
export default App;
PHP If-else-elseif and Switch-case
PHP String Functions - All necessary String functions in PHP to manage strings better.
Popular Tutorials
Popular Tutorials
Categories
-
Artificial Intelligence (AI)
11
-
Bash Scripting
1
-
Bootstrap CSS
0
-
C Programming
14
-
C#
0
-
ChatGPT
1
-
Code Editor
2
-
Computer Engineering
3
-
CSS
28
-
Data Structure and Algorithm
18
-
Design Pattern in PHP
2
-
Design Patterns - Clean Code
1
-
E-Book
1
-
Git Commands
1
-
HTML
19
-
Interview Prepration
2
-
Java Programming
0
-
JavaScript
12
-
Laravel PHP Framework
37
-
Mysql
1
-
Node JS
1
-
Online Business
0
-
PHP
28
-
Programming
8
-
Python
12
-
React Js
19
-
React Native
1
-
Redux
2
-
Rust Programming
15
-
SEO - Search Engine Optimization
1
-
Tailwind CSS
1
-
Typescript
10
-
Uncategorized
0
-
Vue JS
1
-
Windows Operating system
1
-
Woocommerce
1
-
WordPress Development
2
Tags
- Artificial Intelligence (AI)
- Bash Scripting
- Business
- C
- C Programming
- C-sharp programming
- C++
- Code Editor
- Computer Engineering
- CSS
- Data Structure and Algorithm
- Database
- Design pattern
- Express JS
- git
- Git Commands
- github
- HTML
- Java
- JavaScript
- Laravel
- Mathematics
- MongoDB
- Mysql
- Node JS
- PHP
- Programming
- Python
- React Js
- Redux
- Rust Programming Language
- SEO
- TypeScript
- Vue JS
- Windows terminal
- Woocommerce
- WordPress
- WordPress Plugin Development