Open
Description
Please add refactoring action that will improve productivity while working with JSX/TSX. Suppose that I have the following code:
class Page extends React.Component {
render() {
return (
<div>
<h1>{this.props.header}</h1>
</div>
);
}
}
I would like to select line with <h1>
and chose from context menu "Extract to stateless component". And that would create the following stateless component:
const NewComponent = ({ header }) => (<h1>{header}</h1>);
The selected text would be replaced with that:
<NewComponent header={this.props.header} />