Skip to content

Instantly share code, notes, and snippets.

@celian-rib
Last active November 15, 2021 21:43
Show Gist options
  • Save celian-rib/6e1da99167611055e1535b620eed4b6d to your computer and use it in GitHub Desktop.
Save celian-rib/6e1da99167611055e1535b620eed4b6d to your computer and use it in GitHub Desktop.
React Native functional component template in typescript
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