-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
/
react.code-snippets
36 lines (36 loc) · 986 Bytes
/
react.code-snippets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{
"React": {
"scope": "javascriptreact,typescriptreact",
"prefix": "react",
"body": [
"import { ${2:Box}, ${2}Props } from \"@mui/joy\";",
"",
"export function ${1:${TM_FILENAME_BASE/(^|-)(.)/${2:/upcase}/g}}(props: ${1}Props): JSX.Element {",
" const { sx, ...other } = props;",
"",
" return (",
" <${2} sx={{ ...sx }} {...other}>$0</${2}>",
" );",
"}",
"",
"export type ${1}Props = Omit<${2}Props, \"children\">;",
"",
],
"description": "React Component",
},
"ReactRoute": {
"scope": "javascriptreact,typescriptreact",
"prefix": "route",
"body": [
"import { ${2:Box}, ${2}Props } from \"@mui/joy\";",
"",
"export const Component = function ${1:${TM_FILENAME_BASE/(^|-)(.)/${2:/upcase}/g}}(): JSX.Element {",
" return (",
" <${2}>$0</${2}>",
" );",
"}",
"",
],
"description": "React Route Component",
},
}