Skip to content

Instantly share code, notes, and snippets.

@jwrigh26
Created March 13, 2020 18:01
Show Gist options
  • Save jwrigh26/5b031df723e0916504874e8b25de16b2 to your computer and use it in GitHub Desktop.
Save jwrigh26/5b031df723e0916504874e8b25de16b2 to your computer and use it in GitHub Desktop.
{
"Print to console": {
"prefix": "lgvar",
"body": [
"console.log('$1', $1);$0"
],
"description": "Log output to console"
},
"Print String to console": {
"prefix": "lg",
"body": [
"console.log('$1'$0);"
],
"description": "Log output to console"
},
"Print details to console": {
"prefix": "lgverbose",
"body": [
"console.log('------------ START ------------');",
"console.log('$1', $1);$0",
"console.log('------------ END ------------');"
],
"description": "Log output to console"
},
"React function component with classNames": {
"prefix": "rcc",
"body": [
"import React, {$4} from 'react';",
"import PropTypes from 'prop-types';",
"import css from './${3}.scss?module';",
"",
"function ${TM_FILENAME/(.*)\\..+$/${1:/capitalize}/}({ classNames = [] }) {",
" $0",
"",
" return (",
" <div className={[...classNames].join(' ')}>Hello${TM_FILENAME/(.*)\\..+$/${1:/capitalize}/}</div>",
" );",
"}",
"",
"${TM_FILENAME/(.*)\\..+$/${1:/capitalize}/}.propTypes = {",
" classNames: PropTypes.arrayOf(PropTypes.string),",
"}",
"",
"export default ${TM_FILENAME/(.*)\\..+$/${1:/capitalize}/}"
],
"description": "React Functional Component with Classnames prop"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment