@@ -22,11 +22,9 @@ type TypescriptMappings = {
2222 typescriptReactClassExportComponent : 'tsrce' ;
2323 typescriptReactClassExportPureComponent : 'tsrpce' ;
2424 typescriptReactClassPureComponent : 'tsrpc' ;
25- typescriptReactFunctionMemoComponent : 'tsrmc' ;
2625 typescriptReactFunctionalComponent : 'tsrfc' ;
2726 typescriptReactFunctionalExportComponent : 'tsrfce' ;
2827 typescriptReactNativeArrowFunctionComponent : 'tsrnf' ;
29- typescriptReactNativeArrowFunctionComponentNamedProps : 'tsrnfi' ;
3028 typescriptReactNativeArrowFunctionComponentWithStyles : 'tsrnfs' ;
3129} ;
3230
@@ -41,7 +39,7 @@ const exportType: TypescriptSnippet = {
4139const exportInterface : TypescriptSnippet = {
4240 key : 'exportInterface' ,
4341 prefix : 'expint' ,
44- body : [ `export interface ${ Placeholders . FirstTab } {${ Placeholders . LastTab } }` ] ,
42+ body : [ `export interface ${ Placeholders . FirstTab } {}` ] ,
4543} ;
4644
4745const typescriptReactClassComponent : TypescriptSnippet = {
@@ -51,6 +49,7 @@ const typescriptReactClassComponent: TypescriptSnippet = {
5149 'Creates a React component class with ES7 module system and TypeScript interfaces' ,
5250 body : [
5351 ...reactComponent ,
52+ '' ,
5453 ...propsStateInterface ,
5554 `export default class ${ Placeholders . FileName } extends Component<Props, State> {` ,
5655 ' state = {}' ,
@@ -65,6 +64,7 @@ const typescriptReactClassExportComponent: TypescriptSnippet = {
6564 prefix : 'tsrce' ,
6665 body : [
6766 ...reactComponent ,
67+ '' ,
6868 ...propsStateInterface ,
6969 `class ${ Placeholders . FileName } extends Component<Props, State> {` ,
7070 ' state = {}' ,
@@ -82,6 +82,7 @@ const typescriptReactFunctionalExportComponent: TypescriptSnippet = {
8282 prefix : 'tsrfce' ,
8383 body : [
8484 ...react ,
85+ '' ,
8586 ...propsTypeInterface ,
8687 `function ${ Placeholders . FileName } ({}: Props) {` ,
8788 ...innerComponent ,
@@ -97,6 +98,7 @@ const typescriptReactFunctionalComponent: TypescriptSnippet = {
9798 prefix : 'tsrfc' ,
9899 body : [
99100 ...react ,
101+ '' ,
100102 ...propsTypeInterface ,
101103 `export default function ${ Placeholders . FileName } ({}: Props) {` ,
102104 ...innerComponent ,
@@ -111,6 +113,7 @@ const typescriptReactArrowFunctionExportComponent: TypescriptSnippet = {
111113 prefix : 'tsrafce' ,
112114 body : [
113115 ...react ,
116+ '' ,
114117 ...propsTypeInterface ,
115118 `const ${ Placeholders . FileName } = (props: Props) => {` ,
116119 ...innerComponent ,
@@ -126,6 +129,7 @@ const typescriptReactArrowFunctionComponent: TypescriptSnippet = {
126129 prefix : 'tsrafc' ,
127130 body : [
128131 ...react ,
132+ '' ,
129133 ...propsTypeInterface ,
130134 `const ${ Placeholders . FileName } = (props: Props) => {` ,
131135 ...innerComponent ,
@@ -140,6 +144,7 @@ const typescriptReactClassPureComponent: TypescriptSnippet = {
140144 prefix : 'tsrpc' ,
141145 body : [
142146 ...reactPureComponent ,
147+ '' ,
143148 ...propsTypeInterface ,
144149 `export default class ${ Placeholders . FileName } extends PureComponent<Props> {` ,
145150 ...innerComponentReturn ,
@@ -154,6 +159,7 @@ const typescriptReactClassExportPureComponent: TypescriptSnippet = {
154159 prefix : 'tsrpce' ,
155160 body : [
156161 ...reactPureComponent ,
162+ '' ,
157163 ...propsTypeInterface ,
158164 `class ${ Placeholders . FileName } extends PureComponent<Props> {` ,
159165 ...innerComponentReturn ,
@@ -170,6 +176,7 @@ const typescriptReactClassComponentRedux: TypescriptSnippet = {
170176 body : [
171177 "import { connect } from 'react-redux'" ,
172178 ...reactComponent ,
179+ '' ,
173180 ...propsStateInterface ,
174181 `export class ${ Placeholders . FileName } extends Component<Props, State> {` ,
175182 ' state = {}' ,
@@ -188,6 +195,7 @@ const typescriptReactNativeArrowFunctionComponent: TypescriptSnippet = {
188195 body : [
189196 "import { View, Text } from 'react-native'" ,
190197 ...react ,
198+ '' ,
191199 ...propsTypeInterface ,
192200 `const ${ Placeholders . FileName } = (props: Props) => {` ,
193201 ' return (' ,
@@ -199,37 +207,17 @@ const typescriptReactNativeArrowFunctionComponent: TypescriptSnippet = {
199207 ...exportDefault ,
200208 ] ,
201209 description :
202- 'Creates a React Native Arrow Function Component with ES7 module system and TypeScript interface ' ,
210+ 'Creates a React Native Arrow Function Component with ES7 module system in TypeScript' ,
203211} ;
204212
205- const typescriptReactNativeArrowFunctionComponentNamedProps : TypescriptSnippet =
206- {
207- key : 'typescriptReactNativeArrowFunctionComponentNamedProps' ,
208- prefix : 'tsrnfi' ,
209- body : [
210- "import { View } from 'react-native'" ,
211- ...react ,
212- ...propsTypeInterface ,
213- `const ${ Placeholders . FileName } : React.FC<${ Placeholders . FileName } Props> = (props) => {` ,
214- ' return (' ,
215- ' <View>' ,
216- ` ${ Placeholders . LastTab } ` ,
217- ' </View>' ,
218- ' )' ,
219- '}' ,
220- ...exportDefault ,
221- ] ,
222- description :
223- 'Creates a React Native Arrow Function Component with ES7 module system and named TypeScript interface' ,
224- } ;
225-
226213const typescriptReactNativeArrowFunctionComponentWithStyles : TypescriptSnippet =
227214 {
228215 key : 'typescriptReactNativeArrowFunctionComponentWithStyles' ,
229216 prefix : 'tsrnfs' ,
230217 body : [
231218 "import { StyleSheet, Text, View } from 'react-native'" ,
232219 ...react ,
220+ '' ,
233221 ...propsTypeInterface ,
234222 `const ${ Placeholders . FileName } = (props: Props) => {` ,
235223 ' return (' ,
@@ -259,6 +247,5 @@ export default [
259247 typescriptReactClassExportPureComponent ,
260248 typescriptReactClassComponentRedux ,
261249 typescriptReactNativeArrowFunctionComponent ,
262- typescriptReactNativeArrowFunctionComponentNamedProps ,
263250 typescriptReactNativeArrowFunctionComponentWithStyles ,
264251] ;
0 commit comments