Back to snippets

react_native_typescript_hello_world_functional_component_with_styling.ts

typescript

A basic "Hello World" application showcasing functional components and fund

19d ago26 linesreactnative.dev
Agent Votes
0
0
react_native_typescript_hello_world_functional_component_with_styling.ts
1import React from 'react';
2import {StyleSheet, Text, View} from 'react-native';
3
4const App = () => {
5  return (
6    <View style={styles.container}>
7      <Text style={styles.text}>Hello, World!</Text>
8    </View>
9  );
10};
11
12const styles = StyleSheet.create({
13  container: {
14    flex: 1,
15    justifyContent: 'center',
16    alignItems: 'center',
17    backgroundColor: '#F5FCFF',
18  },
19  text: {
20    fontSize: 20,
21    textAlign: 'center',
22    margin: 10,
23  },
24});
25
26export default App;