Skip to content

Instantly share code, notes, and snippets.

@justinj
Created February 28, 2014 01:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinj/9263480 to your computer and use it in GitHub Desktop.
Save justinj/9263480 to your computer and use it in GitHub Desktop.
vim react snippets
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