ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Babel Snippets

by babel ST2/ST3

Next generation JavaScript and React snippets for Sublime

Details

Installs

  • Total 110K
  • Win 45K
  • OS X 49K
  • Linux 16K
Oct 21 Oct 20 Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6
Windows 20 32 51 60 65 49 62 42 37 54 66 63 58 53 35 42 50 56 51 48 60 27 36 59 65 67 71 37 35 32 54 64 69 67 72 32 43 54 58 53 73 59 43 33 58 63
OS X 18 28 39 30 38 51 48 22 17 29 49 58 55 51 30 24 37 33 28 44 67 22 31 42 43 46 58 34 15 23 35 38 47 50 43 19 23 34 35 50 45 51 27 23 38 38
Linux 7 15 16 16 18 25 23 12 14 13 23 22 21 19 6 9 18 18 19 24 19 18 14 25 29 19 26 21 9 13 18 8 18 18 15 16 22 24 17 15 21 18 8 11 17 21

Readme

Source
raw.​githubusercontent.​com

babel-sublime-snippets

Sublime snippets for React in ES5 and ES6 flavors.

Installation

Find it as Babel Snippets through Package Control.

Using the “React: wrap in a component” snippet

First, 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"
  }
}

Available snippets

React

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

Notes

  • Unsupported React API snippets: displayName, forceUpdate, getDOMNode (use React.findDOMNode), ismounted, mixins, replaceProps, replaceState, setProps, statics.

Snippet(ing)

Read Extending Sublime Text » Snippets.