React Component method autocompletion

It'd be nice if WebStorm provided auto completion for React Component methods. For example:

class App extends Component {
someMethod(){
self.setState({});
}

render () {}
}

In the above example for methods inherited from `React.Component` such as `self.setState`, auto completion is not provided. Can this be fixed? 

0
3 comments

Installing React typings (`npm i @types/react`, or Settings | Languages & Frameworks | JavaScript | Libraries, Download... -> react) should help. But note that this might break React props resolving (https://youtrack.jetbrains.com/issue/WEB-29841), make sure to upgrade to the most recent WebStorm version where this issue is resolved

3
Avatar
Permanently deleted user

Thanks it worked.

1
Avatar
Permanently deleted user

Elena, great thanks!!!

1

Please sign in to leave a comment.