- Create Components folder under src folder
- Add ViewEXP1.js file and add below Code
import React from "react";
import { Text, View } from "react-native";
const ViewEXP1 = () => {
return (
<View>
<Text>View example</Text>
<Text>Line 1</Text>
<Text>Line 2</Text>
<Text>Line 2</Text>
</View>
);
};
export default ViewEXP1;
- Open App.js file and update code as below
import React from 'react';
import { View,StyleSheet } from 'react-native';
import ViewEXP1 from './src/components/ViewEXP1'
const App=()=> {
return (
<View style={styles.container}>
<ViewEXP1/>
</View>
);
}
export default App;
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
paddingTop:80
},
});
No comments:
Post a Comment