Skip to content

Instantly share code, notes, and snippets.

@agkovalev
Last active November 6, 2021 14:34
Show Gist options
  • Save agkovalev/257363c3bf17956e36b7257adcbc2b6d to your computer and use it in GitHub Desktop.
Save agkovalev/257363c3bf17956e36b7257adcbc2b6d to your computer and use it in GitHub Desktop.
My VS Code Snippet for typescript react functional component (based on folder name)
{
"Alexey's Functional Component": {
"prefix": ["afc"],
"body": [
"import classes from './index.module.scss';",
"import { FC } from 'react';",
"",
"interface I${TM_DIRECTORY/.*\\\\(.*)$/$1/} {",
"}",
"",
"export const ${TM_DIRECTORY/.*\\\\(.*)$/$1/}: FC<I${TM_DIRECTORY/.*\\\\(.*)$/$1/}> = (props) => {",
"return (",
"<div className={classes.wrapper}>",
"${TM_DIRECTORY/.*\\\\(.*)$/$1/}",
"</div>",
");",
"}"
],
"description": "Functional React Component by Alexey"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment