Welcome to %s forums

<No. 1 Community for developers, by developers/>

Login Register

How to code hello world program in React Native?

React Native related topics are here
Post Reply
admin
Site Admin
Posts: 45

How to code hello world program in React Native?

Post by admin » Sun Oct 20, 2019 12:32 am

Hello World

Editing index.ios.js or index.android.js
Open index.ios.js or index.android.js and delete everything between the <View> </View>. After that, write
<Text> Hello World! </Text> and run the emulator.
You should see Hello World! written on the screen!
Congrats! You've successfully written your first Hello World!

Code: Select all

import React, { Component } from 'react';
import { AppRegistry, Text } from 'react-native';
class HelloWorldApp extends Component {
 render() {
 return (
 <Text>Hello world!</Text>
 );
 }
}
AppRegistry.registerComponent('HelloWorldApp', () => HelloWorldApp);

Post Reply