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 blog image

The countdown to March 31 is on.

Make the switch from app center suck less with Sentry.

Read more

Top comments (2)

Collapse
 
gitkat profile image
GitKat

Thanks :D

Collapse
 
gouravmpk profile image
Gourav Kadu

Welcome : P

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs