Last active
August 30, 2019 10:28
-
-
Save FDiskas/d23783f7f631ec6a662b4ffbc7503682 to your computer and use it in GitHub Desktop.
VSCode snippets "React-Native"
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
{ | |
"Component": { | |
"prefix": "comp", | |
"body": [ | |
"import * as React from 'react';", | |
"import { View, StyleSheet, ViewStyle, Text } from 'react-native';", | |
"", | |
"interface ComponentProps {}", | |
"interface ComponentState {}", | |
"interface Styles {", | |
" ${2:wrapper}: ViewStyle;", | |
"}", | |
"", | |
"export class ${1:${TM_FILENAME_BASE}}Component extends React.Component<ComponentProps, ComponentState> {", | |
" state = {};", | |
"", | |
" render() {", | |
" const {} = this.state;", | |
" const {} = this.props;", | |
"", | |
" return (", | |
" <View style={styles.${2:wrapper}}>", | |
" <Text>${TM_FILENAME}</Text>", | |
" </View>", | |
" );", | |
" }", | |
"}", | |
"", | |
"const styles = StyleSheet.create<Styles>({", | |
" ${2:wrapper}: { ${3:flex: 1} },", | |
"});", | |
"" | |
], | |
"description": "Create react-native Component" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment