react-function-to-class
Convert functions to React classes in a keystroke
germtb 2,801 2 0.2.4 MIT GitHub

Convert functions to classes

  • There is no default keybinding for this package. Create your own pointing to: react-function-to-class:toClass or use it from the command palette.

Supports arrow functions, anonymous functions and function declarations.

Configuration

You can extend anything you like: React.Component, React.PureComponent, Inferno.Component...

Optionally auto-implement methods you might want to use:

  • constructor
  • componentWillMount
  • componentDidMount