Created
January 22, 2019 13:54
-
-
Save crisu83/4a30d83ef7af1acd488aba3c80159014 to your computer and use it in GitHub Desktop.
My VS Code React snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"reactClassComponent": { | |
"prefix": "rcc", | |
"body": "import * as React from 'react'\n\nclass ${TM_FILENAME_BASE} extends React.Component {\n\trender() {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t$0\n\t\t\t</div>\n\t\t)\n\t}\n}\n\nexport default ${TM_FILENAME_BASE}\n", | |
"description": "Creates a React component class" | |
}, | |
"reactPureComponent": { | |
"prefix": "rpc", | |
"body": "import * as React from 'react'\n\nclass ${TM_FILENAME_BASE} extends React.PureComponent {\n\trender() {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t$0\n\t\t</div>\n\t\t)\n\t}\n}\n\nexport default ${TM_FILENAME_BASE}\n", | |
"description": "Creates a React pure component class" | |
}, | |
"reactFunctionalComponent": { | |
"prefix": "rfc", | |
"body": "import * as React from 'react'\n\nconst ${TM_FILENAME_BASE} = ({}) => (\n\t<div>\n\t\t\t\n\t</div>\n)\n\nexport default ${TM_FILENAME_BASE}\n", | |
"description": "Creates a functional React component" | |
}, | |
"reactClassComponentFlow": { | |
"prefix": "rccf", | |
"body": "// @flow\n\nimport * as React from 'react'\n\ntype ${TM_FILENAME_BASE}Props = {\n\t\n}\n\nclass ${TM_FILENAME_BASE} extends React.Component<${TM_FILENAME_BASE}Props> {\n\trender() {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t$0\n\t\t\t</div>\n\t\t)\n\t}\n}\n\nexport default ${TM_FILENAME_BASE}\n", | |
"description": "Creates a React component class using Flow" | |
}, | |
"reactPureComponentFlow": { | |
"prefix": "rpcf", | |
"body": "// @flow\n\nimport * as React from 'react'\n\ntype ${TM_FILENAME_BASE}Props = {\n\t\n}\n\nclass ${TM_FILENAME_BASE} extends React.PureComponent<${TM_FILENAME_BASE}Props> {\n\trender() {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t$0\n\t\t\t</div>\n\t\t)\n\t}\n}\n\nexport default ${TM_FILENAME_BASE}\n", | |
"description": "Creates a React pure component class using Flow" | |
}, | |
"reactFunctionalComponentFlow": { | |
"prefix": "rfcf", | |
"body": "// @flow\n\nimport * as React from 'react'\n\ntype ${TM_FILENAME_BASE}Props = {\n\t\n}\n\nconst ${TM_FILENAME_BASE} = ({}: ${TM_FILENAME_BASE}Props) => (\n\t<div>\n\t\t\n\t</div>\n)\n\nexport default ${TM_FILENAME_BASE}\n", | |
"description": "Creates a functional React component using Flow" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment