Created
March 13, 2020 18:01
-
-
Save jwrigh26/5b031df723e0916504874e8b25de16b2 to your computer and use it in GitHub Desktop.
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
{ | |
"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