@@ -22,11 +22,9 @@ type TypescriptMappings = {
22
22
typescriptReactClassExportComponent : 'tsrce' ;
23
23
typescriptReactClassExportPureComponent : 'tsrpce' ;
24
24
typescriptReactClassPureComponent : 'tsrpc' ;
25
- typescriptReactFunctionMemoComponent : 'tsrmc' ;
26
25
typescriptReactFunctionalComponent : 'tsrfc' ;
27
26
typescriptReactFunctionalExportComponent : 'tsrfce' ;
28
27
typescriptReactNativeArrowFunctionComponent : 'tsrnf' ;
29
- typescriptReactNativeArrowFunctionComponentNamedProps : 'tsrnfi' ;
30
28
typescriptReactNativeArrowFunctionComponentWithStyles : 'tsrnfs' ;
31
29
} ;
32
30
@@ -41,7 +39,7 @@ const exportType: TypescriptSnippet = {
41
39
const exportInterface : TypescriptSnippet = {
42
40
key : 'exportInterface' ,
43
41
prefix : 'expint' ,
44
- body : [ `export interface ${ Placeholders . FirstTab } {${ Placeholders . LastTab } }` ] ,
42
+ body : [ `export interface ${ Placeholders . FirstTab } {}` ] ,
45
43
} ;
46
44
47
45
const typescriptReactClassComponent : TypescriptSnippet = {
@@ -51,6 +49,7 @@ const typescriptReactClassComponent: TypescriptSnippet = {
51
49
'Creates a React component class with ES7 module system and TypeScript interfaces' ,
52
50
body : [
53
51
...reactComponent ,
52
+ '' ,
54
53
...propsStateInterface ,
55
54
`export default class ${ Placeholders . FileName } extends Component<Props, State> {` ,
56
55
' state = {}' ,
@@ -65,6 +64,7 @@ const typescriptReactClassExportComponent: TypescriptSnippet = {
65
64
prefix : 'tsrce' ,
66
65
body : [
67
66
...reactComponent ,
67
+ '' ,
68
68
...propsStateInterface ,
69
69
`class ${ Placeholders . FileName } extends Component<Props, State> {` ,
70
70
' state = {}' ,
@@ -82,6 +82,7 @@ const typescriptReactFunctionalExportComponent: TypescriptSnippet = {
82
82
prefix : 'tsrfce' ,
83
83
body : [
84
84
...react ,
85
+ '' ,
85
86
...propsTypeInterface ,
86
87
`function ${ Placeholders . FileName } ({}: Props) {` ,
87
88
...innerComponent ,
@@ -97,6 +98,7 @@ const typescriptReactFunctionalComponent: TypescriptSnippet = {
97
98
prefix : 'tsrfc' ,
98
99
body : [
99
100
...react ,
101
+ '' ,
100
102
...propsTypeInterface ,
101
103
`export default function ${ Placeholders . FileName } ({}: Props) {` ,
102
104
...innerComponent ,
@@ -111,6 +113,7 @@ const typescriptReactArrowFunctionExportComponent: TypescriptSnippet = {
111
113
prefix : 'tsrafce' ,
112
114
body : [
113
115
...react ,
116
+ '' ,
114
117
...propsTypeInterface ,
115
118
`const ${ Placeholders . FileName } = (props: Props) => {` ,
116
119
...innerComponent ,
@@ -126,6 +129,7 @@ const typescriptReactArrowFunctionComponent: TypescriptSnippet = {
126
129
prefix : 'tsrafc' ,
127
130
body : [
128
131
...react ,
132
+ '' ,
129
133
...propsTypeInterface ,
130
134
`const ${ Placeholders . FileName } = (props: Props) => {` ,
131
135
...innerComponent ,
@@ -140,6 +144,7 @@ const typescriptReactClassPureComponent: TypescriptSnippet = {
140
144
prefix : 'tsrpc' ,
141
145
body : [
142
146
...reactPureComponent ,
147
+ '' ,
143
148
...propsTypeInterface ,
144
149
`export default class ${ Placeholders . FileName } extends PureComponent<Props> {` ,
145
150
...innerComponentReturn ,
@@ -154,6 +159,7 @@ const typescriptReactClassExportPureComponent: TypescriptSnippet = {
154
159
prefix : 'tsrpce' ,
155
160
body : [
156
161
...reactPureComponent ,
162
+ '' ,
157
163
...propsTypeInterface ,
158
164
`class ${ Placeholders . FileName } extends PureComponent<Props> {` ,
159
165
...innerComponentReturn ,
@@ -170,6 +176,7 @@ const typescriptReactClassComponentRedux: TypescriptSnippet = {
170
176
body : [
171
177
"import { connect } from 'react-redux'" ,
172
178
...reactComponent ,
179
+ '' ,
173
180
...propsStateInterface ,
174
181
`export class ${ Placeholders . FileName } extends Component<Props, State> {` ,
175
182
' state = {}' ,
@@ -188,6 +195,7 @@ const typescriptReactNativeArrowFunctionComponent: TypescriptSnippet = {
188
195
body : [
189
196
"import { View, Text } from 'react-native'" ,
190
197
...react ,
198
+ '' ,
191
199
...propsTypeInterface ,
192
200
`const ${ Placeholders . FileName } = (props: Props) => {` ,
193
201
' return (' ,
@@ -199,37 +207,17 @@ const typescriptReactNativeArrowFunctionComponent: TypescriptSnippet = {
199
207
...exportDefault ,
200
208
] ,
201
209
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' ,
203
211
} ;
204
212
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
-
226
213
const typescriptReactNativeArrowFunctionComponentWithStyles : TypescriptSnippet =
227
214
{
228
215
key : 'typescriptReactNativeArrowFunctionComponentWithStyles' ,
229
216
prefix : 'tsrnfs' ,
230
217
body : [
231
218
"import { StyleSheet, Text, View } from 'react-native'" ,
232
219
...react ,
220
+ '' ,
233
221
...propsTypeInterface ,
234
222
`const ${ Placeholders . FileName } = (props: Props) => {` ,
235
223
' return (' ,
@@ -259,6 +247,5 @@ export default [
259
247
typescriptReactClassExportPureComponent ,
260
248
typescriptReactClassComponentRedux ,
261
249
typescriptReactNativeArrowFunctionComponent ,
262
- typescriptReactNativeArrowFunctionComponentNamedProps ,
263
250
typescriptReactNativeArrowFunctionComponentWithStyles ,
264
251
] ;
0 commit comments