Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8c2ef06

Browse files
SeanDamian Sznajder
Sean
authored and
Damian Sznajder
committed
add option for functional and anon functional components
1 parent 9950c9d commit 8c2ef06

File tree

2 files changed

+86
-18
lines changed

2 files changed

+86
-18
lines changed

‎README.md

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -250,67 +250,77 @@ export default class FileName extends Component {
250250
}
251251
```
252252

253-
### `rfe`
253+
### `rfcp`
254254

255255
```javascript
256256
import React from 'react'
257+
import PropTypes from 'prop-types'
257258

258-
const 1ドル=props=> {
259+
function 1ドル() {
259260
return <div>0ドル</div>
260261
}
261262

263+
1ドル.propTypes = {}
264+
262265
export default 1ドル
263266
```
264267

265-
### `rfep`
268+
### `rfc`
266269

267270
```javascript
268271
import React from 'react'
269-
import PropTypes from 'prop-types'
270272

271-
const1ドル=props=> {
273+
exportdefaultfunction1ドル() {
272274
return <div>0ドル</div>
273275
}
276+
```
274277

275-
1ドル.propTypes = {}
278+
### `rfce`
279+
280+
```javascript
281+
import React from 'react'
282+
283+
function 1ドル() {
284+
return <div>0ドル</div>
285+
}
276286

277287
export default 1ドル
278288
```
279289

280-
### `rfc`
290+
### `rafcp`
281291

282292
```javascript
283293
import React from 'react'
294+
import PropTypes from 'prop-types'
284295

285-
exportdefault () => {
296+
const1ドル=props => {
286297
return <div>0ドル</div>
287298
}
299+
300+
1ドル.propTypes = {}
301+
302+
export default 1ドル
288303
```
289304

290-
### `rfce`
305+
### `rafc`
291306

292307
```javascript
293308
import React from 'react'
294309

295-
const1ドル= () => {
310+
exportdefault () => {
296311
return <div>0ドル</div>
297312
}
298-
299-
export default 1ドル
300313
```
301314

302-
### `rfcp`
315+
### `rafce`
303316

304317
```javascript
305318
import React from 'react'
306-
import PropTypes from 'prop-types'
307319

308320
const 1ドル = () => {
309321
return <div>0ドル</div>
310322
}
311323

312-
1ドル.propTypes = {}
313-
314324
export default 1ドル
315325
```
316326

‎snippets/snippets.json

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@
251251
"body": [
252252
"import React from 'react'",
253253
"",
254-
"const ${1:${TM_FILENAME_BASE}} = () => {",
254+
"function ${1:${TM_FILENAME_BASE}}() {",
255255
" return (",
256256
" <div>",
257257
" 0ドル",
@@ -269,7 +269,7 @@
269269
"body": [
270270
"import React from 'react'",
271271
"",
272-
"export default () => {",
272+
"export default function ${1:${TM_FILENAME_BASE}}() {",
273273
" return (",
274274
" <div>",
275275
" 0ドル",
@@ -282,6 +282,64 @@
282282
},
283283
"reactFunctionalComponentWithPropTypes": {
284284
"prefix": "rfcp",
285+
"body": [
286+
"import React from 'react'",
287+
"import PropTypes from 'prop-types'",
288+
"",
289+
"function ${1:${TM_FILENAME_BASE}}() {",
290+
" return (",
291+
" <div>",
292+
" 0ドル",
293+
" </div>",
294+
" )",
295+
"}",
296+
"",
297+
"${1:${TM_FILENAME_BASE}}.propTypes = {",
298+
"",
299+
"}",
300+
"",
301+
"export default ${1:${TM_FILENAME_BASE}}",
302+
"",
303+
""
304+
],
305+
"description": "Creates a React Functional Component with ES7 module system with PropTypes"
306+
},
307+
"reactAnonymousFunctionalExportComponent": {
308+
"prefix": "rafce",
309+
"body": [
310+
"import React from 'react'",
311+
"",
312+
"const ${1:${TM_FILENAME_BASE}} = () => {",
313+
" return (",
314+
" <div>",
315+
" 0ドル",
316+
" </div>",
317+
" )",
318+
"}",
319+
"",
320+
"export default ${1:${TM_FILENAME_BASE}}",
321+
""
322+
],
323+
"description": "Creates a React Anonymous Functional Component with ES7 module system"
324+
},
325+
"reactAnonymousFunctionalComponent": {
326+
"prefix": "rafc",
327+
"body": [
328+
"import React from 'react'",
329+
"",
330+
"export default const ${1:${TM_FILENAME_BASE}} = () => {",
331+
" return (",
332+
" <div>",
333+
" 0ドル",
334+
" </div>",
335+
" )",
336+
"}",
337+
""
338+
],
339+
"description": "Creates a React Anonymous Functional Component with ES7 module system"
340+
},
341+
"reactAnonymousFunctionalComponentWithPropTypes": {
342+
"prefix": "rafcp",
285343
"body": [
286344
"import React from 'react'",
287345
"import PropTypes from 'prop-types'",

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /