Last active
July 9, 2020 12:56
-
-
Save arinthros/438817f16ce2f016c94604aedfa030ff to your computer and use it in GitHub Desktop.
Custom React snippets for VSCode
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
// Place in the snippets folder of vscode | |
{ | |
// shortcode: impc | |
// Creates an empty React function component with a common set of items, like imports and proptypes | |
// Tab stop 1 is the function name | |
// Tab stop 2 is for props | |
"Create empty component": { | |
"scope": "javascript", | |
"prefix": "impc", | |
"body": [ | |
"import React from 'react'", | |
"import PropTypes from 'prop-types'", | |
"", | |
"export function $1({$2}) {", | |
"", | |
" return (", | |
" <>", | |
" $0", | |
" </>", | |
" )", | |
"}", | |
"", | |
"$1.propTypes = {", | |
" $2", | |
"}", | |
"", | |
"$1.defaultProps = {", | |
" $2", | |
"}", | |
"", | |
], | |
"description": "Creates empty component" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment