Top level 'this' expression

Webstorm 2019.1.1, React. After the last update I receive this message which should not appear

Reports this expressions occurring outside of object literals or constructor bodies. Such this expressions are legal JavaScript, and reference the top-level "global" JavaScript object, but are largely useless.

Comment actions Permalink

Seeing the same issue.

Comment actions Permalink

To provide some more detail: I see it in the render function here:

export default class Test extends React.Component {
constructor ( props ) {

this.state = { data :}

render() {
return <div>{}</div>;

This should not be highlighted as a top level this, because it is bound to the instance the render method is invoked on.


Please sign in to leave a comment.