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

Baobab React ES6 Snippets

by luccitan ST2/ST3

ES6 based Sublime Text snippets for React along with Baobab

Details

  • 1.0.0
  • github.​com
  • 11 months ago
  • 24 minutes ago
  • 10 months ago

Installs

  • Total 2K
  • Win 1K
  • OS X 722
  • Linux 218
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 Sep 3
Windows 1 1 13 5 4 4 5 0 5 1 1 2 1 4 2 3 6 3 4 4 8 9 3 8 3 6 6 5 5 9 5 2 5 10 9 7 14 4 2 2 2 5 4 11 13 4
OS X 0 2 2 2 1 2 4 0 6 3 0 2 3 2 1 1 0 1 2 2 2 7 2 7 1 2 5 4 1 3 1 2 2 5 4 6 1 1 0 1 2 4 6 1 3 0
Linux 0 1 0 1 0 1 1 0 2 2 0 0 0 0 0 1 0 0 2 0 0 0 1 2 0 0 2 1 1 1 0 0 0 1 0 1 0 0 0 0 0 1 2 0 0 1

Readme

Source
raw.​githubusercontent.​com

sublime-baobab-react-es6

This is a fork of mbopreator's React ES6 Sublime Package. It intends to bring snippets for Baobab users along with React, thanks to the higher-order components integration

This fork keeps the following main features: - 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.

This fork brings these main changes: - Removing rrc for Redux connected components. (not used with Baobab simultaneously) - Adding a snippet to create a rooted component using the Baobab higher-order components - Adding a snippet to create a branched component using the Baobab higher-order components

/!\ New snippets brought by this fork are not supported for Coffeescript, feel free to contribute to it /!\

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 Baobab, select Baobab React ES6 Snippets

Usage

Syntax highlighting

Syntax highlighting is not provided by this package. Using babel-sublime instead is recommanded.

Snippets

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

Documentation of available snippets (JSX):

baobc→  baobab-branched component skeleton

  baorc→  baobab-rooted component skeleton

    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 ... }

    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.