Created
February 25, 2022 11:39
-
-
Save syntaxlexx/abb3942061424d44b4598ce93c3370cf to your computer and use it in GitHub Desktop.
React Native VSCode Code Snippets
This file contains 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
Show hidden characters
{ | |
"React Native Component": { | |
"prefix": "rnc", | |
"body": [ | |
"import React, { useState } from \"react\";", | |
"import { StyleSheet, View } from \"react-native\";", | |
"", | |
"import AppText from \"@/components/AppText\";", | |
"import defaultStyles from \"@/constants/Styles\";", | |
"", | |
"function ${TM_FILENAME_BASE}({ navigation }) {", | |
" return <View style={styles.container}>", | |
" <AppText>Welcome Home</AppText>", | |
" </View>;", | |
"}", | |
"", | |
"const styles = StyleSheet.create({", | |
" container: {", | |
" paddingHorizontal: defaultStyles.padding,", | |
" paddingTop: defaultStyles.padding,", | |
" }", | |
"});", | |
"", | |
"export default ${TM_FILENAME_BASE};", | |
"" | |
], | |
"description": "React Native Component" | |
}, | |
"React Native Native Base Component": { | |
"prefix": "rnnc", | |
"body": [ | |
"import React, { useState } from \"react\";", | |
"import { StyleSheet } from \"react-native\";", | |
"import { Box } from \"native-base\";", | |
"", | |
"import AppText from \"@/components/AppText\";", | |
"import defaultStyles from \"@/constants/Styles\";", | |
"", | |
"function ${TM_FILENAME_BASE}({ navigation }) {", | |
" return (", | |
" <Box style={styles.container}>", | |
" <AppText>$1</AppText>", | |
" </Box>", | |
" );", | |
"}", | |
"", | |
"const styles = StyleSheet.create({", | |
" container: {", | |
" paddingHorizontal: defaultStyles.padding,", | |
" paddingTop: defaultStyles.padding,", | |
" },", | |
"});", | |
"", | |
"export default ${TM_FILENAME_BASE};", | |
"" | |
], | |
"description": "React Native Native Base Component" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment