Last active
November 15, 2021 21:43
-
-
Save celian-rib/6e1da99167611055e1535b620eed4b6d to your computer and use it in GitHub Desktop.
React Native functional component template in typescript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { StyleSheet, Text, View } from 'react-native'; | |
interface Props { | |
someProp: string; | |
} | |
const ComponentName = (props: Props): JSX.Element => { | |
const { | |
someProp | |
} = props; | |
return ( | |
<View style={styles.container}> | |
<Text>{someProp}</Text> | |
</View> | |
); | |
}; | |
export default ComponentName; | |
const styles = StyleSheet.create({ | |
container: { | |
backgroundColor: '#000' | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment