Skip to content

Instantly share code, notes, and snippets.

@bendera
Last active January 16, 2023 13:36
Show Gist options
  • Save bendera/4fce3c203b8a760f5911e45673d9fa71 to your computer and use it in GitHub Desktop.
Save bendera/4fce3c203b8a760f5911e45673d9fa71 to your computer and use it in GitHub Desktop.
My VSCode React snippets
{
"Create a new functional component": {
"prefix": "fc",
"body": [
"import React, { FC } from 'react';",
"import './${TM_FILENAME_BASE}.css';",
"",
"interface ${TM_FILENAME_BASE}Props {",
" props1: string;",
" props2: string;",
"}",
"",
"const ${TM_FILENAME_BASE}: FC<${TM_FILENAME_BASE}Props> = ({ props1, props2 }) => {",
" return (",
" <div>",
" {props1}",
" {props2}",
" </div>",
" );",
"};",
"",
"export default ${TM_FILENAME_BASE};",
""
]
},
"Import component CSS": {
"prefix": "fccss",
"body": [
"import './${TM_FILENAME_BASE}.css';"
]
},
"Import component CSS module": {
"prefix": "fccssm",
"body": [
"import styles from './${TM_FILENAME_BASE}.module.css';"
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment