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.4.0
  • github.​com
  • 2 years ago
  • 2 hours ago
  • 2 years ago

Installs

  • Total 42K
  • Win 17K
  • OS X 19K
  • Linux 6K
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 Sep 5 Sep 4
Windows 28 36 41 44 19 26 37 44 19 34 23 12 16 8 27 25 22 24 14 28 28 38 48 42 30 17 29 42 44 39 46 51 18 33 36 56 60 48 20 20 24 32 28 53 53 50
OS X 28 29 37 30 14 14 25 29 13 39 22 9 12 20 23 17 23 27 14 23 23 38 24 32 41 10 24 32 33 34 42 32 22 32 46 59 28 27 20 12 24 27 23 38 31 36
Linux 9 4 4 11 5 8 2 6 2 9 9 6 9 4 10 7 8 10 4 5 10 12 7 9 18 9 11 10 4 10 5 13 8 10 10 13 8 12 4 3 4 7 3 3 9 5

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.