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
  • 1 year ago
  • 9 hours ago
  • 1 year ago

Installs

  • Total 3K
  • Win 2K
  • OS X 1K
  • Linux 321
Feb 25 Feb 24 Feb 23 Feb 22 Feb 21 Feb 20 Feb 19 Feb 18 Feb 17 Feb 16 Feb 15 Feb 14 Feb 13 Feb 12 Feb 11 Feb 10 Feb 9 Feb 8 Feb 7 Feb 6 Feb 5 Feb 4 Feb 3 Feb 2 Feb 1 Jan 31 Jan 30 Jan 29 Jan 28 Jan 27 Jan 26 Jan 25 Jan 24 Jan 23 Jan 22 Jan 21 Jan 20 Jan 19 Jan 18 Jan 17 Jan 16 Jan 15 Jan 14 Jan 13 Jan 12 Jan 11
Windows 4 8 5 3 3 2 1 0 1 1 2 1 1 5 4 3 6 4 11 10 1 3 4 7 12 13 7 13 2 2 5 8 8 12 9 3 5 13 11 8 16 3 1 5 6 10
OS X 2 2 4 7 0 1 2 3 0 0 3 0 5 2 1 1 0 1 5 2 3 2 2 4 4 3 8 4 1 1 3 0 6 3 4 3 1 3 4 6 8 0 0 1 7 2
Linux 1 0 0 1 0 1 1 0 0 2 0 1 1 2 0 1 0 1 0 1 2 0 1 2 0 2 1 2 0 0 1 1 0 1 1 0 1 1 2 1 0 1 0 0 1 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.