JS: model one more 'autobind' for js/unbound-event-handler-receiver

This commit is contained in:
Esben Sparre Andreasen
2019-02-21 08:23:54 +01:00
parent 5754eb666c
commit 27cae0c190
2 changed files with 24 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
import React from 'react';
import autoBind from 'auto-bind';
import reactAutobind from 'react-autobind';
class Component0 extends React.Component {
render() {
@@ -155,4 +155,22 @@ class Component3 extends React.Component {
}
}
class Component4 extends React.Component {
render() {
return <div>
<div onClick={this.bound_throughReactAutobind}/> // OK
</div>
}
constructor(props) {
super(props);
reactAutobind(this);
}
bound_throughReactAutobind() {
this.setState({ });
}
}
// semmle-extractor-options: --experimental