Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save gthrm/2f753c8211d2a864e0cfb2f45ca28ebb to your computer and use it in GitHub Desktop.
Save gthrm/2f753c8211d2a864e0cfb2f45ca28ebb to your computer and use it in GitHub Desktop.
react-functional-component-ts-folder-name
{
"react-functional-component-ts-folder-name": {
"prefix": "rfc",
"body": [
"import React from 'react';",
"",
"interface ${TM_DIRECTORY/.*\\/(.*)$/$1/g}Props {",
" ${2:propName}?: string;", // Assuming the prop type is string for demonstration; adjust as necessary.
"}",
"",
"const ${TM_DIRECTORY/.*\\/(.*)$/$1/g}: React.FC<${TM_DIRECTORY/.*\\/(.*)$/$1/g}Props> = ({ ${2:propName} }) => {",
" return (",
" <></>",
" );",
"};",
"",
"export default ${TM_DIRECTORY/.*\\/(.*)$/$1/g};"
],
"description": "TypeScript react-functional-component"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment