mirror of
https://github.com/enso-org/enso.git
synced 2024-12-29 03:44:11 +03:00
5079b21207
- The update handling is no longer reactive, so it will no longer cause unnecessary re-renders Other changes: - Rename `Root` component to `UIProviders` to be more descriptive # Important Notes None
43 lines
1003 B
Plaintext
43 lines
1003 B
Plaintext
{
|
|
"React Component": {
|
|
"prefix": ["$c", "component"],
|
|
"body": [
|
|
"// ====${1/./=/g}====",
|
|
"// === $1 ===",
|
|
"// ====${1/./=/g}====",
|
|
"",
|
|
"/** Props for a {@link ${1:$TM_FILENAME_BASE}}. */",
|
|
"export interface $1Props {",
|
|
" $3",
|
|
"}",
|
|
"",
|
|
"/** $2 */",
|
|
"export default function $1(props: $1Props) {",
|
|
" const { ${3/(.+?):.+/$1, /g} } = props",
|
|
" return <>$4</>",
|
|
"}",
|
|
],
|
|
},
|
|
"React Hook": {
|
|
"prefix": ["$h", "hook"],
|
|
"body": [
|
|
"// =======${1/./=/g}====",
|
|
"// === use$1 ===",
|
|
"// =======${1/./=/g}====",
|
|
"",
|
|
"/** $2 */",
|
|
"export function use$1($3) {",
|
|
" $4",
|
|
"}",
|
|
],
|
|
},
|
|
"useState": {
|
|
"prefix": ["$s", "usestate"],
|
|
"body": ["const [$1, set${1/(.*)/${1:/pascalcase}/}] = React.useState($2)"],
|
|
},
|
|
"section": {
|
|
"prefix": ["$S", "section"],
|
|
"body": ["// ====${1/./=/g}====", "// === $1 ===", "// ====${1/./=/g}===="],
|
|
},
|
|
}
|