1
0
Fork 0
mirror of synced 2024-12-29 01:53:21 -05:00
ultimate-vim/sources_non_forked/vim-snippets/UltiSnips/coffee-react.snippets

81 lines
1.7 KiB
Text
Raw Normal View History

2015-12-08 08:20:04 -05:00
#
# CoffeeScript versions -- adapted from coffee-jasmine
# for some ReactJS matchers.
#
priority -50
extends coffee
priority -49
snippet createClass "React define Class" b
${1:classname}Class = React.createClass
displayName: "$1"
render: ->
2017-02-11 08:01:38 -05:00
$2
2015-12-08 08:20:04 -05:00
$1 = React.createFactory($1)
endsnippet
snippet PropTypes "React define propTypes" b
propTypes: ->
${1:myVar}: React.PropTypes.${2:type}${3:.isRequired}
endsnippet
snippet propType "React propType (key/value)" b
${1:myVar}: React.PropTypes.${2:type}${3:.isRequired}
2017-02-11 08:01:38 -05:00
$4
2015-12-08 08:20:04 -05:00
endsnippet
snippet setState "React setState" b
@setState
${1:myvar}: ${2:myvalue}
2017-02-11 08:01:38 -05:00
$3
2015-12-08 08:20:04 -05:00
endsnippet
snippet getInitialState "React define getInitialState" b
getInitialState: ->
${1:myvar}: ${2:myvalue}
2017-02-11 08:01:38 -05:00
$3
2015-12-08 08:20:04 -05:00
endsnippet
snippet getDefaultProps "React define getDefaultProps" b
getDefaultProps: ->
${1:myvar}: ${2:myvalue}
2017-02-11 08:01:38 -05:00
$3
2015-12-08 08:20:04 -05:00
endsnippet
snippet componentWillMount "React define componentWillMount" b
componentWillMount: ->
2017-02-11 08:01:38 -05:00
$1
2015-12-08 08:20:04 -05:00
endsnippet
snippet componentDidMount "React define componentDidMount" b
componentDidMount: ->
2017-02-11 08:01:38 -05:00
$1
2015-12-08 08:20:04 -05:00
endsnippet
snippet componentWillReceiveProps "React define componentWillReceiveProps" b
componentWillReceiveProps: (nextProps) ->
2017-02-11 08:01:38 -05:00
$1
2015-12-08 08:20:04 -05:00
endsnippet
snippet shouldComponentUpdate "React define shouldComponentUpdate" b
shouldComponentUpdate: (nextProps, nextState) ->
2017-02-11 08:01:38 -05:00
$1
2015-12-08 08:20:04 -05:00
endsnippet
snippet componentWillUpdate "React define componentWillUpdate" b
componentWillUpdate: (nextProps, nextState) ->
2017-02-11 08:01:38 -05:00
$1
2015-12-08 08:20:04 -05:00
endsnippet
snippet componentDidUpdate "React define componentDidUpdate" b
componentDidUpdate: (prevProps, prevState) ->
2017-02-11 08:01:38 -05:00
$1
2015-12-08 08:20:04 -05:00
endsnippet
snippet componentWillUnmount "React define componentWillUnmount" b
componentWillUnmount: ->
2017-02-11 08:01:38 -05:00
$1
2015-12-08 08:20:04 -05:00
endsnippet