Skip to content

Instantly share code, notes, and snippets.

@syntaxlexx
Created February 25, 2022 11:39
Show Gist options
  • Save syntaxlexx/abb3942061424d44b4598ce93c3370cf to your computer and use it in GitHub Desktop.
Save syntaxlexx/abb3942061424d44b4598ce93c3370cf to your computer and use it in GitHub Desktop.
React Native VSCode Code Snippets
{
"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