Skip to content

Instantly share code, notes, and snippets.

@frencojobs
Last active November 10, 2020 05:14
Show Gist options
  • Save frencojobs/c5bcbb26f19736bc9b2164eecddd3ad2 to your computer and use it in GitHub Desktop.
Save frencojobs/c5bcbb26f19736bc9b2164eecddd3ad2 to your computer and use it in GitHub Desktop.
My vscode snippets.
{
"react functional component": {
"prefix": "rfc",
"body": [
"export const ${TM_FILENAME_BASE/(\\w)/${1:/upcase}/}: React.FC = () => {",
" return <>$0</>",
"}"
],
"description": "react functional component"
},
"react functional component with props": {
"prefix": "rfcp",
"body": [
"type Props = {}",
"",
"export const ${TM_FILENAME_BASE/(\\w)/${1:/upcase}/}: React.FC<Props> = () => {",
" return <>$0</>",
"}"
],
"description": "react functional component with props"
},
"next page component": {
"prefix": "npc",
"body": [
"import { NextPage } from 'next'",
"",
"const ${TM_FILENAME_BASE/(\\w)/${1:/upcase}/}Page: NextPage = () => {",
" return <>$0</>",
"}",
"",
"export default ${TM_FILENAME_BASE/(\\w)/${1:/upcase}/}Page"
],
"description": "next page component"
},
"next page component with props": {
"prefix": "npcp",
"body": [
"import { NextPage } from 'next'",
"",
"type Props = {}",
"",
"const ${TM_FILENAME_BASE/(\\w)/${1:/upcase}/}Page: NextPage<Props> = () => {",
" return <>$0</>",
"}",
"",
"export default ${TM_FILENAME_BASE/(\\w)/${1:/upcase}/}Page"
],
"description": "next page component with props"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment