sublime中支持React的Snippets片段插件--ReactJS

sublime-react

Snippets for ReactJS. This package used to provide JSX Syntax highlighting and has been DEPRECATED in favor of babel/babel-sublime.

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 ReactJS

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.

Snippets are available for both JSX and CJSX (React CoffeeScript).

Documentation of available snippets (JSX):

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

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

     cs→  var cx = React.addons.classSet;

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

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

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

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

     cx→  cx({ ... })

    fdn→  React.findDOMNode(...)

    fup→  forceUpdate(...)

    gdp→  getDefaultProps: fn() { return {...} } 

    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.

Contributor License Agreement

Contributions are very welcome,but we ask that you please fill out our CLA in order for us to accept your pull request.

相关文章

一、前言 在组件方面react和Vue一样的,核心思想玩的就是组件...
前言: 前段时间学习完react后,刚好就接到公司一个react项目...
前言: 最近收到组长通知我们项目组后面新开的项目准备统一技...
react 中的高阶组件主要是对于 hooks 之前的类组件来说的,如...
我们上一节了解了组件的更新机制,但是只是停留在表层上,例...
我们上一节了解了 react 的虚拟 dom 的格式,如何把虚拟 dom...