react-function-to-class:toClass
or use it from the command palette.Supports arrow functions, anonymous functions and function declarations.
You can extend anything you like: React.Component
, React.PureComponent
, Inferno.Component
...
Optionally auto-implement methods you might want to use:
constructor
componentWillMount
componentDidMount
Good catch. Let us know what about this package looks wrong to you, and we'll investigate right away.