Last active
January 16, 2023 13:36
-
-
Save bendera/4fce3c203b8a760f5911e45673d9fa71 to your computer and use it in GitHub Desktop.
My VSCode React snippets
This file contains hidden or 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
{ | |
"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