Your First React Native Application

2 min read

In this blog we will learn how to create a react native app
Step 1: Creating a new application
Make a folder with any name and open it in VS Code
In my case i have created the folder React Native
Run the following commands
npx @react-native-community/cli@latest init AwesomeProject_01
wait some time and it will initialise a project name AwesomeProject_01
Open the developer options in your phone and set USB debugging and enable file transfer by default
Connect your Device and run the command
adb devices
Step 2: Start Metro
After successfully executing the above commands open the AwesomeProject_01 folder in VS Code
And run the following command
npm start
This command will start metro which is the JavaScript build tool for React Native.
Step 3: Start your application
npx react-native run-android
- If everything is set up correctly, you should see your app running in mobile shortly.
Step 4: Modifying your app
paste the code in your App.tsx file
import React from "react";
import {
View,
Text,
SafeAreaView,
} from "react-native"
function App(){
return(
<SafeAreaView>
<View>
<Text> Hello World! </Text>
</View>
</SafeAreaView>
)
}
export default App;
You should get the below view in Your Phone
Congrats , Now Your App is now Running .
Note: For installation visit:
1
Subscribe to my newsletter
Read articles from Neuron directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
