Last active
November 6, 2021 14:34
-
-
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)
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
{ | |
"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