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 73K
  • Win 28K
  • OS X 35K
  • Linux 10K
Oct 24 Oct 23 Oct 22 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
Windows 32 61 37 36 39 60 47 48 67 24 32 39 72 44 63 63 30 35 36 45 47 53 51 39 40 38 50 68 59 59 31 40 64 64 61 76 58 32 46 61 86 77 70 39 37 36
OS X 21 58 46 34 41 53 48 62 56 24 29 41 61 40 74 68 22 44 43 55 55 50 59 36 46 46 62 60 72 58 27 45 58 64 70 74 74 50 45 80 105 82 54 43 35 35
Linux 10 8 13 12 19 25 16 18 18 11 14 12 14 8 20 23 14 19 15 21 24 24 21 17 7 18 20 22 19 14 10 11 13 20 20 24 15 12 23 20 38 19 16 16 10 17

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.