Skip to content

Commit 4ca6586

Browse files
nkntnxDamian Sznajder
authored and
Damian Sznajder
committed
Add react native arrow function component with styles
Added a new template for "rnfs" similar to "rnf" but with a "StyleSheet" declaration.
1 parent ba88561 commit 4ca6586

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

snippets/snippets.json

+20
Original file line numberDiff line numberDiff line change
@@ -948,6 +948,26 @@
948948
""
949949
]
950950
},
951+
"reactNativeArrowFunctionComponentWithStyles": {
952+
"prefix": "rnfs",
953+
"body": [
954+
"import React from 'react'",
955+
"import { View, Text, StyleSheet } from 'react-native'",
956+
"",
957+
"const ${1:${TM_FILENAME_BASE}} = () => {",
958+
"\treturn (",
959+
"\t\t<View>",
960+
"\t\t\t<Text>$0</Text>",
961+
"\t\t</View>",
962+
"\t)",
963+
"}",
964+
"",
965+
"const styles = StyleSheet.create({})",
966+
"",
967+
"export default ${1:${TM_FILENAME_BASE}}",
968+
""
969+
]
970+
},
951971
"reactNativeImport": {
952972
"prefix": "imrn",
953973
"body": "import { ${1:moduleName} } from 'react-native'"

0 commit comments

Comments
 (0)