Skip to content

Instantly share code, notes, and snippets.

@ryuichi24
Created February 12, 2023 09:18
Show Gist options
  • Select an option

  • Save ryuichi24/471d7b8afedab45adc582a0bb8e0fcc0 to your computer and use it in GitHub Desktop.

Select an option

Save ryuichi24/471d7b8afedab45adc582a0bb8e0fcc0 to your computer and use it in GitHub Desktop.
{
"console.log": {
"prefix": "clg",
"body": ["console.log($1)"]
},
"template for React Function Component": {
"prefix": "rf",
"body": [
"import React from 'react'",
"",
"type ${TM_FILENAME_BASE}Props = {",
"$1",
"}",
"",
"export const $TM_FILENAME_BASE: React.FC<${TM_FILENAME_BASE}Props> = ({$2}) => {",
"\t\treturn (<>${TM_FILENAME_BASE}</>);",
"}"
],
"description": "Typescript React Function Component"
},
"template for useState": {
"prefix": "us",
"body": ["const [$1, set${1/(.)/${1:/upcase}/}] = useState<$2>($3);"]
},
"template for export all": {
"prefix": "ex",
"description": "export statement to export all items from module",
"body": [
"export * from \"$1\";",
""
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment