"Convert to function component" option is disabled in React app
I placed the caret in the code below (first few lines shown) and the "Convert to function component" Refactor option is disabled. Why would it be disabled?
class App extends React.Component {
constructor(props) {
super(props);
config({
editorStylingMode: 'filled'
});
this.dataSource = service.getEmployees();
this.states = service.getStates();
this.dataGrid = React.createRef();
this.notesEditorOptions = { height: 100 };
}
render() {
return (.......
Please sign in to leave a comment.
It's not supported for complex cases (components with lifecycle methods, instance methods, etc.).
Try to delete the constructor from your class then he will show it for you
from :

TO :
Then :