Hello World In REACT NATIVE

gouravmpk

Gourav Kadu

Posted on November 3, 2021

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.

💖 💪 🙅 🚩
gouravmpk
Gourav Kadu

Posted on November 3, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Hello World In REACT NATIVE
reactnative Hello World In REACT NATIVE

November 3, 2021