From df5869fba839db05bee7be14186d904c11a584e4 Mon Sep 17 00:00:00 2001 From: Navneet Karnani Date: Mon, 17 Feb 2020 10:38:57 +0530 Subject: [PATCH] Add react native arrow function component with styles Added a new template for "rnfs" similar to "rnf" but with a "StyleSheet" declaration. --- snippets/snippets.json | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/snippets/snippets.json b/snippets/snippets.json index 6c4f69d..1c8d4b3 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -948,6 +948,26 @@ "" ] }, + "reactNativeArrowFunctionComponentWithStyles": { + "prefix": "rnfs", + "body": [ + "import React from 'react'", + "import { View, Text, StyleSheet } from 'react-native'", + "", + "const ${1:${TM_FILENAME_BASE}} = () => {", + "\treturn (", + "\t\t", + "\t\t\t$0", + "\t\t", + "\t)", + "}", + "", + "const styles = StyleSheet.create({})", + "", + "export default ${1:${TM_FILENAME_BASE}}", + "" + ] + }, "reactNativeImport": { "prefix": "imrn", "body": "import { ${1:moduleName} } from 'react-native'"