Created
February 28, 2014 01:33
-
-
Save justinj/9263480 to your computer and use it in GitHub Desktop.
vim react snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
snippet cc | |
React.createClass({ | |
${0} | |
}); | |
snippet cdm | |
componentDidMount: function(${1:rootNode}) { | |
${0} | |
}, | |
snippet cdu | |
componentDidUpdate: function(${1:prevProps}, ${2:prevState}, ${3:rootNode}) { | |
${0} | |
}, | |
snippet cwm | |
componentWillMount: function() { | |
${0} | |
}, | |
snippet cwrp | |
componentWillReceiveProps: function(${1:nextProps}) { | |
${0} | |
}, | |
snippet cwu | |
componentWillUpdate: function(${1:nextProps}, ${2:nextState}) { | |
${0} | |
}, | |
snippet cwum | |
componentWillUnmount: function() { | |
${0} | |
}, | |
snippet gdp | |
getDefaultProps: function() { | |
${0} | |
}, | |
snippet gis | |
getInitialState: function() { | |
${0} | |
}, | |
snippet r | |
render: function() { | |
${0} | |
}, | |
snippet rc | |
React.renderComponent( | |
${1}, | |
${0} | |
); | |
snippet scu | |
shouldComponentUpdate: function(${1:nextProps}, ${2:nextState}) { | |
${0} | |
}, | |
snippet ss | |
this.setState({${0}}); | |
snippet dpt | |
${1:prop}: React.PropTypes.${2:type} | |
snippet pt | |
React.PropTypes.${1:type} | |
snippet pts | |
propTypes: { | |
${0} | |
}, | |
snippet ptsn | |
React.PropTypes.oneOfType([ | |
React.PropTypes.string, | |
React.PropTypes.number | |
]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment