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

React ES6 Snippets

by mboperator ALL

ES6 based Sublime Text snippets for React.

Labels snippets, jsx, es6, react

Details

  • 0.5.0
  • github.​com
  • 6 years ago
  • 2 hours ago
  • 8 years ago

Installs

  • Total 90K
  • Win 43K
  • Mac 33K
  • Linux 14K
Dec 1 Nov 30 Nov 29 Nov 28 Nov 27 Nov 26 Nov 25 Nov 24 Nov 23 Nov 22 Nov 21 Nov 20 Nov 19 Nov 18 Nov 17 Nov 16 Nov 15 Nov 14 Nov 13 Nov 12 Nov 11 Nov 10 Nov 9 Nov 8 Nov 7 Nov 6 Nov 5 Nov 4 Nov 3 Nov 2 Nov 1 Oct 31 Oct 30 Oct 29 Oct 28 Oct 27 Oct 26 Oct 25 Oct 24 Oct 23 Oct 22 Oct 21 Oct 20 Oct 19 Oct 18 Oct 17
Windows 4 4 3 1 5 2 2 1 3 2 5 0 2 1 0 2 2 2 0 1 0 3 5 2 2 2 2 3 2 1 3 0 1 3 2 4 2 2 2 2 0 5 2 2 3 2
Mac 1 2 2 1 0 0 1 0 1 0 0 1 2 1 0 1 1 0 0 1 0 1 1 0 1 2 0 0 0 0 0 0 0 0 0 1 1 2 0 0 0 0 2 0 1 0
Linux 0 1 2 1 1 0 0 2 2 2 0 0 3 0 0 1 2 2 0 1 1 1 1 0 0 1 0 0 1 1 0 0 1 1 0 0 2 1 0 0 2 1 2 0 0 1

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.