forked from rafi/vim-config
-
Notifications
You must be signed in to change notification settings - Fork 109
/
Copy pathjavascript.snip
98 lines (91 loc) · 1.35 KB
/
javascript.snip
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
snippet cs
var cx = React.addons.classSet;
snippet cdm
componentDidMount: function() {
${1}
},
snippet cdup
componentDidUpdate: function(prevProps, prevState) {
${1}
},
snippet cwm
componentWillMount: function() {
${1}
},
snippet cwr
componentWillReceiveProps: function(nextProps) {
${1}
},
snippet cwun
componentWillUnmount: function() {
${1}
},
snippet cwu
componentWillUpdate: function(nextProps, nextState) {
${1}
},
snippet cx
cx({
${1}: ${2}
});
snippet fup
forceUpdate(${1:callback});
snippet gdp
getDefaultProps: function() {
return {
${1}
};
},
snippet gis
getInitialState: function() {
return {
${1}: ${2}
};
},
snippet ism
isMounted()
snippet jsx
/**
* @jsx React.DOM
*/
var React = require('react');
var ${1:ClassName} = React.createClass({
render: function() {
return (
${0:<div />}
);
}
});
module.exports = $1;
snippet pt
propTypes: {
${1}: React.PropTypes.${2:string}
},
snippet rcc
var ${1:ClassName} = React.createClass({
render: function() {
return (
${0:<div />}
);
}
});
snippet ren
render: function() {
return (
${1:<div />}
);
}
snippet sst
setState({
${1}: ${2}
});
snippet scu
shouldComponentUpdate: function(nextProps, nextState) {
${1}
},
snippet props
this.props.${1}
snippet state
this.state.${1}
snippet trp
transferPropsTo(${1});