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 02846af

Browse files
whoisryosukeDamian Sznajder
authored and
Damian Sznajder
committed
🐛 Fixed rfcp by defining component name
Can't apply proptypes outside of a class/function without using a named function. This change defines the component function by the filename, and exports it separately (since directly exported const aren't supported).
1 parent 16a45df commit 02846af

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎snippets/snippets.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@
315315
"import React from 'react'",
316316
"import PropTypes from 'prop-types'",
317317
"",
318-
"export default () => {",
318+
"const ${1:${TM_FILENAME_BASE}} = () => {",
319319
" return (",
320320
" <div>",
321321
" 0ドル",
@@ -326,6 +326,9 @@
326326
"${1:${TM_FILENAME_BASE}}.propTypes = {",
327327
"",
328328
"}",
329+
"",
330+
"export default ${1:${TM_FILENAME_BASE}}",
331+
"",
329332
""
330333
],
331334
"description": "Creates a React Functional Component with ES7 module system with PropTypes"

0 commit comments

Comments
(0)

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