2023-09-27 10:22:48 +03:00
|
|
|
{
|
|
|
|
"React Component": {
|
|
|
|
"prefix": ["$c", "component"],
|
|
|
|
"body": [
|
2024-02-12 13:05:30 +03:00
|
|
|
"// ====${1/./=/g}====",
|
|
|
|
"// === $1 ===",
|
|
|
|
"// ====${1/./=/g}====",
|
|
|
|
"",
|
|
|
|
"/** Props for a {@link ${1:$TM_FILENAME_BASE}}. */",
|
2023-09-27 10:22:48 +03:00
|
|
|
"export interface $1Props {",
|
2024-02-12 13:05:30 +03:00
|
|
|
" $3",
|
2023-09-27 10:22:48 +03:00
|
|
|
"}",
|
|
|
|
"",
|
|
|
|
"/** $2 */",
|
|
|
|
"export default function $1(props: $1Props) {",
|
2024-02-12 13:05:30 +03:00
|
|
|
" const { ${3/(.+?):.+/$1, /g} } = props",
|
|
|
|
" return <>$4</>",
|
2024-08-09 11:05:45 +03:00
|
|
|
"}",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
"React Hook": {
|
|
|
|
"prefix": ["$h", "hook"],
|
|
|
|
"body": [
|
|
|
|
"// =======${1/./=/g}====",
|
|
|
|
"// === use$1 ===",
|
|
|
|
"// =======${1/./=/g}====",
|
|
|
|
"",
|
|
|
|
"/** $2 */",
|
|
|
|
"export function use$1($3) {",
|
|
|
|
" $4",
|
|
|
|
"}",
|
|
|
|
],
|
2023-09-27 10:22:48 +03:00
|
|
|
},
|
|
|
|
"useState": {
|
|
|
|
"prefix": ["$s", "usestate"],
|
2024-08-09 11:05:45 +03:00
|
|
|
"body": ["const [$1, set${1/(.*)/${1:/pascalcase}/}] = React.useState($2)"],
|
2024-02-29 13:36:47 +03:00
|
|
|
},
|
|
|
|
"section": {
|
|
|
|
"prefix": ["$S", "section"],
|
2024-08-09 11:05:45 +03:00
|
|
|
"body": ["// ====${1/./=/g}====", "// === $1 ===", "// ====${1/./=/g}===="],
|
|
|
|
},
|
2023-09-27 10:22:48 +03:00
|
|
|
}
|