This repository has been archived by the owner on Nov 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
frontend.code-snippets
73 lines (73 loc) · 1.97 KB
/
frontend.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
{
"Next.js Page (twin.macro)": {
"scope": "typescriptreact",
"prefix": "Page",
"body": [
"import React from 'react'",
"import 'twin.macro'",
"",
"export default function $1Page() {",
" return <>",
" $1",
" </>",
"}"
]
},
"React Function Component (twin.macro)": {
"scope": "typescriptreact",
"prefix": "Function Component",
"body": [
"import { FC } from 'react'",
"import 'twin.macro'",
"",
"export const $1: FC = () => {",
" return <>",
" $1",
" </>",
"}"
]
},
"React Function Component with Props Interface (twin.macro)": {
"scope": "typescriptreact",
"prefix": "Function Component with Props Interface",
"body": [
"import { FC } from 'react'",
"import 'twin.macro'",
"",
"export interface $1Props {}",
"export const $1: FC<$1Props> = () => {",
" return <>",
" $1",
" </>",
"}"
]
},
"React Function Component with Props Interface & Children (twin.macro)": {
"scope": "typescriptreact",
"prefix": "Function Component with Props Interface",
"body": [
"import { FC, PropsWithChildren } from 'react'",
"import 'twin.macro'",
"",
"export interface $1Props extends PropsWithChildren {}",
"export const $1: FC<$1Props> = ({ children }) => {",
" return <>$0{children}</>",
"}"
]
},
"React Inline Function Component": {
"scope": "typescriptreact",
"prefix": "Inline Function Component",
"body": ["const $1: FC$0 = () => <>", " $1", "</>"]
},
"React Inline Function Component with Props": {
"scope": "typescriptreact",
"prefix": "Inline Function Component with Props",
"body": ["const $1Props = { }", "const $1: FC$0<$1Props> = ({}) => <>", " $1", "</>"]
},
"CSS JSX-Attribute (twin.macro)": {
"scope": "typescriptreact",
"prefix": "css jsx attribute (twin)",
"body": ["css={[tw$0``]}"]
}
}