-
Notifications
You must be signed in to change notification settings - Fork 133
/
Copy pathjavascriptreact.json
128 lines (127 loc) · 4.08 KB
/
javascriptreact.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
{
/*
// Place your snippets for JavaScript React here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
*/ "React Native Component": {
"prefix": "imrnc",
"body": [
"import React, { Component } from \"react\";",
"import { \n\tView,\n\tText,\n\tStyleSheet\n} from \"react-native\";",
"\nclass ${1:componentName} extends Component {",
"\trender() {",
"\t\treturn (",
"\t\t\t<View style={styles.container}>",
"\t\t\t\t<Text>${1:componentName}</Text>",
"\t\t\t</View>",
"\t\t);",
"\t}",
"}",
"export default ${1:componentName};",
"\nconst styles = StyleSheet.create({",
"\tcontainer: {",
"\t\tflex: 1,",
"\t\talignItems: 'center',",
"\t\tjustifyContent: 'center'",
"\t}",
"});"
],
"description": "React Component"
},
"Create StyleSheet": {
"prefix": "imrnss",
"body": [
"const styles = StyleSheet.create({",
"\n$0",
"\n});\n"
],
"description": "Const Styles"
},
"console.log": {
"prefix": "clog",
"body": [
"console.log(${1:})"
],
"description": "console.log"
},
"React Native Pan Responder": {
"prefix": "imrnp",
"body": [
"this.panResponder = PanResponder.create({",
"\n\tonMoveShouldSetPanResponder: (evt, gestureState) => true,",
"\tonPanResponderGrant: (evt, gestureState) =>{",
"\n\t},",
"\tonPanResponderMove: (evt, gestureState) => {",
"\n\t},",
"\tonPanResponderRelease: (evt, gestureState) => {",
"\n\t},",
"\n})"
],
"description": "React Native Pan Responder"
},
"React Native Functional Component": {
"prefix": "imrnfc",
"body": [
"import React from \"react\";",
"import { \n\tView,\n\tText,\n\tStyleSheet\n} from \"react-native\";",
"\nconst ${1:componentName} = (props) => (",
"\t<View style={styles.container}>",
"\t\t<Text>${1:componentName}</Text>",
"\t</View>",
"\t)",
"export default ${1:componentName};",
"\nconst styles = StyleSheet.create({",
"\tcontainer: {",
"\t\tflex: 1,",
"\t\talignItems: 'center',",
"\t\tjustifyContent: 'center'",
"\t}",
"});"
],
"description": "React Native Functional Component"
},
"React Native Map Function": {
"prefix": "rnmap",
"body": [
"return ${1:items}.map((item,index)=>{",
"\treturn(",
"\t\t${2:<View></View>}",
")})"
],
"description": "javscript map method"
},
"React Native Dimensions": {
"prefix": "rndime",
"body": [
"const {width,height} = Dimensions.get('window')"
],
"description": "Dimensions RN"
},
"React Native Component Only":{
"prefix":"rncomp",
"body":[
"\nclass ${1:componentName} extends Component{",
"\trender(){",
"\t\treturn (",
"\t\t\t<View style={{flex:1,alignItems:'center',justifyContent:'center'}}>",
"\t\t\t\t<Text>${1:componentName}</Text>",
"\t\t\t</View>",
"\t\t);",
"\t}",
"}"
],
"description":"New React Native Component"
},
"React Native Functional Component Only":{
"prefix":"rnfcomp",
"body":[
"\nconst ${1:componentName} = (props) => (",
"\t<View style={{flex:1,alignItems:'center',justifyContent:'center'}}>",
"\t\t<Text>${1:componentName}</Text>",
"\t</View>",
")"
],
"description":"New React Native Component"
}
}