DEV Community

Cover image for Hello World In REACT NATIVE
Gourav Kadu
Gourav Kadu

Posted on

6 1

Hello World In REACT NATIVE

Steps To Create App in React Native

  1. Setup environment for react native.

  2. Open Terminal/command prompt in the folder you want to create app in .

  3. Enter

    npx react-native init app_name

    2021-11-02.png

  4. Once the app is created , Open app folder in your ide or editor (I'm using VS code).
    2021-11-02 (3).png

  5. Open App.js, there will be default code template given try running it by opening Terminal/command prompt in App Folder respectively.

    To run the app write

    npx react-native run-android

    2021-11-02 (2).png

  6. Once the App runs replace all the code in App.js with

import React, {Component} from 'react';  
import {Platform, StyleSheet, Text, View} from 'react-native';  


export default class App extends Component {  
  render() {  
    return (  
      <View>  
        <Text>Hello World</Text>  
      </View>  
    );  
  }  
}  
Enter fullscreen mode Exit fullscreen mode

And refresh the code by pressing "R" in node terminal , don't forget to save before refreshing.

2021-11-02 (5).png

THATS IT FOR Hello World :)

Try Tinkering with the code to understand better.

Sentry mobile image

Mobile Vitals: A first step to Faster Apps

Slow startup times, UI hangs, and frozen frames frustrate users—but they’re also fixable. Mobile Vitals help you measure and understand these performance issues so you can optimize your app’s speed and responsiveness. Learn how to use them to reduce friction and improve user experience.

Read the guide

Top comments (2)

Collapse
 
gitkat profile image
GitKat

Thanks :D

Collapse
 
gouravmpk profile image
Gourav Kadu

Welcome : P