Hello World in React-Native
1) Hello World Example in Functional Component
import React from 'react';
import { Text, View } from 'react-native';
function HelloWorldApp (){
return (
<View
style={{
flex: 1,
justifyContent: "center",
alignItems: "center"
}}>
<Text>Hello, world!</Text>
</View>
)
}
export default HelloWorldApp;
2) Hello World Example in Class Component
import React, { Component } from 'react';
import { Text } from 'react-native';
class HelloWorld extends Component {
render() {
return (
<Text>HelloWorld!</Text>
);
}
}
export default HelloWorld;
OUTPUT
Comments
Post a Comment