View, Text, Style in React Native
1) View, Text, Style in React Native
View:- View is the basic component in React native to show all other components on the screen, It will be wrapped around the other components like Text, Button, Textinput, etc.
Text:-Text is used to show the text like paragraph or labels etc,
Style:- Style is used to style all the specific components like height, width, color, etc.
import React from 'react';
import { View, Text } from 'react-native';
export default function HelloWorld(){
return(
//This is View
<View
// This is style
style={{
flex:1,
justifyContent:'center',
alignItems:'center',
backgroundColor:'red'
}}>
{/* This is Text */}
<Text style={{
fontSize:22,
fontWeight:'bold',
color:'white'
}}>HelloWorld</Text>
</View>
)
}
OUTPUT
Comments
Post a Comment