Skip to content

Instantly share code, notes, and snippets.

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