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

React ES6 Snippets

by mboperator ST2/ST3

ES6 based Sublime Text snippets for React.

Labels snippets, jsx, es6, react

Details

  • 0.5.0
  • github.​com
  • 1 year ago
  • 2 hours ago
  • 3 years ago

Installs

  • Total 59K
  • Win 26K
  • OS X 25K
  • Linux 8K
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 Sep 5 Sep 4 Sep 3 Sep 2 Sep 1 Aug 31 Aug 30 Aug 29 Aug 28 Aug 27 Aug 26 Aug 25 Aug 24 Aug 23 Aug 22 Aug 21 Aug 20 Aug 19 Aug 18 Aug 17 Aug 16 Aug 15 Aug 14 Aug 13 Aug 12 Aug 11 Aug 10 Aug 9 Aug 8 Aug 7 Aug 6
Windows 27 42 38 40 10 28 23 36 34 33 26 15 13 26 37 67 23 92 18 22 31 35 28 38 27 16 11 30 40 33 26 47 12 18 29 38 41 38 39 16 22 34 25 29 40 58
OS X 9 14 17 10 7 12 13 20 13 22 20 15 8 21 26 10 21 20 10 10 19 18 20 20 33 9 5 12 17 20 18 31 8 14 7 26 13 27 20 6 14 21 21 18 25 23
Linux 4 6 9 6 6 7 10 9 9 9 7 3 5 3 12 14 7 9 4 4 4 6 6 14 10 8 5 7 6 8 6 5 6 5 6 6 6 10 10 7 8 6 10 11 8 10

Readme

Source
raw.​githubusercontent.​com

sublime-react-es6

This is a fork of Facebook's original ReactJS Sublime Package.

The main changes I've made include:

  • Converting function declarations to the new ES6 shorthand.

  • Static class variables (defaultProps, propTypes) are declared using ES7 property intializers.

  • ES6 style exports and imports for component creating snippets.

  • Added rrc for Redux connected components.

alt tag

Installation

Install the React package via Sublime's Package Manager

You will need the Sublime Package Manager.

  • Open the command palette: ⌘+shift+p on MacOS/Linux, ctrl+shift+p on Windows

  • type install, select Package Control: Install Package

  • type React, select React ES6 Snippets

Usage

Syntax highlighting

Syntax highlighting is no longer provided by this packages. We recommend that you use (babel-sublime) instead.

Snippets

It's easy! Simply activate snippets by typing a mnemonic followed by TAB.

alt tag

Documentation of available snippets (JSX):

cdm→  componentDidMount: fn() { ... }

   cdup→  componentDidUpdate: fn(pp, ps) { ... }

     cs→  import cx from 'classnames';

    cwm→  componentWillMount: fn() { ... }

    cwr→  componentWillReceiveProps: fn(np) { ... }

    cwu→  componentWillUpdate: fn(np, ns) { ... }

   cwun→  componentWillUnmount: fn() { ... }

     cx→  cx({ ... })

    fdn→  React.findDOMNode(...)

    fup→  forceUpdate(...)

    gdp→  static defaultProps = { ... } 

    gis→  getInitialState: fn() { return {...} } 

    ism→  isMounted()

  props→  this.props.

     pt→  propTypes { ... }

    rcc→  component skeleton

   refs→  this.refs.

    ren→  render: fn() { return ... }

    rpc→  pure render component skeleton

    rrc→  redux component skeleton

    scu→  shouldComponentUpdate: fn(np, ns) { ... }

    sst→  this.setState({ ... })

  state→  this.state.

Contributing

Rebuilding the docs

After making changes to snippet files, run npm install && npm run build-docs to automatically generate this document from source. Do not make changes to README.md directly.