Snippet
|
Prefix
|
Body
|
React: componentDidMount: fn() { ... }
|
cdm
|
componentDidMount: function() { ${1} },
|
React: componentDidUpdate: fn(pp, ps) { ... }
|
cdup
|
componentDidUpdate: function(prevProps, prevState) { ${1} },
|
React: componentWillMount: fn() { ... }
|
cwm
|
componentWillMount: function() { ${1} },
|
React: componentWillReceiveProps: fn(np) { ... }
|
cwr
|
componentWillReceiveProps: function(nextProps) { ${1} },
|
React: componentWillUnmount: fn() { ... }
|
cwun
|
componentWillUnmount: function() { ${1} },
|
React: componentWillUpdate: fn(np, ns) { ... }
|
cwu
|
componentWillUpdate: function(nextProps, nextState) { ${1} },
|
React: cx({ ... })
|
cx
|
cx({ $1: $2 });
|
React: forceUpdate(...)
|
fup
|
forceUpdate(${1:callback});
|
React: getDefaultProps: fn() { return {...} }
|
gdp
|
getDefaultProps: function() { return { ${1} }; },
|
React: getInitialState: fn() { return {...} }
|
gis
|
getInitialState: function() { return { ${1}: ${2} }; },
|
React: isMounted()
|
ism
|
isMounted()
|
React: propTypes { ... }
|
pt
|
propTypes: { ${1}: React.PropTypes.${2:string} },
|
React: component skeleton
|
rcc6
|
import React from 'react' const $1 = React.createClass({ render () { return ( ) } }) export default ${1}
|
React: render: fn() { return ... }
|
ren
|
render: function() { return ( ${1:<div />} ); }
|
React: setState({ ... })
|
sst6
|
this.setState({ ${1}: ${2} });
|
React: shouldComponentUpdate: fn(np, ns) { ... }
|
scu
|
shouldComponentUpdate: function(nextProps, nextState) { ${1} },
|
React: this.props.
|
props
|
this.props.${1}
|
React: this.state.
|
state
|
this.state.${1}
|
React: render(component, container, [callback])
|
rrc
|
React.render(${1:<$2 />}, ${3:document.body}${4:, ${5:callback}});
|
React: componentDidMount() { ... }
|
cdm6
|
componentDidMount() { ${1} }
|
React: componentDidUpdate(pp, ps) { ... }
|
cdup6
|
componentDidUpdate(prevProps, prevState) { ${1} }
|
React: componentWillMount() { ... }
|
cwm6
|
componentWillMount() { ${1} }
|
React: componentWillReceiveProps(np) { ... }
|
cwr6
|
componentWillReceiveProps(nextProps) { ${1} }
|
React: componentWillUnmount() { ... }
|
cwun6
|
componentWillUnmount: function() { ${1} }
|
React: componentWillUpdate(np, ns) { ... }
|
cwu6
|
componentWillUpdate: function(nextProps, nextState) { ${1} }
|
React: static defaultProps = { ... }
|
dp
|
static defaultProps = { ${1} }
|
React: this.state = { ... }
|
is
|
this.state = { ${1}: ${2} }
|
React: static propTypes = { ... }
|
pt6
|
static propTypes = { ${1}: React.PropTypes.${2:string} },
|
React: class skeleton
|
rcd
|
import React from 'react' class $1 extends React.Component { render () { } } export default ${1};
|
React: render() { return ... }
|
ren6
|
render() { return ( ${1:<div />} ); }
|
React: shouldComponentUpdate(np, ns) { ... }
|
scu6
|
shouldComponentUpdate(nextProps, nextState) { ${1} },
|
React: const { props: { ... } } = this
|
props6
|
const { props: { ${1} } } = this
|