React Native minimal app component
· One min read
Minimal code required to start a React-Native component is
a. An App Class which extends from React.Component
b. styles that are created from StyleSheet.Create()
import React from "react";
import { StyleSheet, Text, View } from "react-native";
export default class App extends React.Component {
render() {
return (
<View style={styles.container}>
<Text>Hello World</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center'
}
});