Skip to content

Instantly share code, notes, and snippets.

@cbejensen
Last active June 13, 2022 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cbejensen/0698a051f8c97ecb9509fc2dac18b727 to your computer and use it in GitHub Desktop.
Save cbejensen/0698a051f8c97ecb9509fc2dac18b727 to your computer and use it in GitHub Desktop.
VS Code React Component Snippet
{
"Component": {
"prefix": "fc",
"body": [
"import React from 'react';",
"",
"export interface ${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}Props {",
"\t$1",
"}",
"",
"export function ${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}(${2:props}: ${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}Props) {",
"\t$3",
"\treturn ${4:null};",
"}"
],
"description": "Minimal function component"
}
}
@cbejensen
Copy link
Author

Assumes kebab-case file names

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment