-
Notifications
You must be signed in to change notification settings - Fork 0
/
typescriptreact.json
72 lines (71 loc) · 2.05 KB
/
typescriptreact.json
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
{
"Typescript React PureComponent": {
"prefix": "rpc",
"body": [
"import * as React from 'react'",
"",
"export class $1 extends React.PureComponent {",
"\trender() {",
"\t\treturn ($2);",
"}}"
],
"description": "Typescript React PureComponent"
},
"Typescript React Function Component": {
"prefix": "rh",
"body": [
"import React from 'react'",
"",
"interface ${TM_FILENAME_BASE}Props {",
"$1",
"}",
"",
"export const $TM_FILENAME_BASE: React.FC<${TM_FILENAME_BASE}Props> = ({$2}) => {",
"\t\treturn ($3);",
"}"
],
"description": "Typescript React Function Component"
},
"React Native StyleSheet": {
"prefix": "rnss",
"body": [
"import {StyleSheet} from 'react-native'",
"const styles = StyleSheet.create({",
"",
"});"
],
"description": "React Native StyleSheet"
},
"Toggle State": {
"prefix": "tog",
"body": ["this.setState(state => ({", "\topen: !state.open", "}));"],
"description": "toggle state"
},
"console.log": {
"prefix": "cl",
"body": ["console.log($1)"],
"description": "console.log"
},
"className={classnames()}": {
"prefix": "cc",
"body": ["className={classnames('$1')}"],
"description": "tailwind react stuff"
},
"Apollo Query Component": {
"prefix": "apq",
"body": [
"interface Props {",
" children: (data: QueryResult<$1, OperationVariables>) => JSX.Element;",
"}",
"",
"export class $2 extends React.PureComponent<Props> {",
" render() {",
" return (",
" <Query<$1> query={$3}>{x => this.props.children(x)}</Query>",
" );",
" }",
"}"
],
"description": "Apollo Query Component"
}
}