Sublime snippets for React in ES5 and ES6 flavors.
Find it as Babel Snippets through Package Control.
Using the "React: wrap in a component" snippetFirst, select a block of JSX. Then, from the Command Palette select "React: wrap in a component". Or, you can set up a key binding.
To set a key binding, go to "Preferences: Key Bindings - User" from the Command Palette and add an entry like this:
{ "keys": ["ctrl+shift+,"], "command": "insert_snippet", "args": { "name": "Packages/Babel Snippets/react_wrap.sublime-snippet" } }Trigger Content
rcc→
class component skeleton rcc→
legacy component skeleton cdm→
componentDidMount() {…}
cdup→
componentDidUpdate(prevProps, prevState) {…}
cwm→
componentWillMount() {…}
cwr→
componentWillReceiveProps(nextProps) {…}
cwun→
componentWillUnmount() {…}
cwup→
componentWillUpdate(nextProps, nextState) {…}
fdn→
React.findDOMNode(…)
gdp→
getDefaultProps() {…}
gis→
getInitialState() {…}
ren→
render() {…}
sst→
this.setState(…)
scu→
shouldComponentUpdate(nextProps, nextState) {…}
props→
this.props
state→
this.state
pt→
propTypes { ... }
pta→
PropTypes.arrayOf
ptai→
PropTypes.arrayOf (Instances)
ptb→
PropTypes.bool
pte→
PropTypes.element
ptf→
PropTypes.func
pti→
PropTypes.instanceOf
ptn→
PropTypes.number
ptn→
PropTypes.node
pto→
PropTypes.object
ptof→
PropTypes.oneOf (Enum)
ptof→
PropTypes.objectOf
ptoft→
PropTypes.oneOfType (Union)
pts→
PropTypes.string
ptsp→
PropTypes.shape
displayName
, forceUpdate
, getDOMNode
(use React.findDOMNode
), ismounted
, mixins
, replaceProps
, replaceState
, setProps
, statics
.Read Extending Sublime Text » Snippets.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4