refactor(ui): use new style method definition to avoid bind() calls in constructor

This commit is contained in:
Łukasz Mierzwa
2018-07-31 14:26:57 +02:00
parent 5d1084b8e7
commit 9d1f15e85c

View File

@@ -15,12 +15,6 @@ class BaseLabel extends Component {
value: PropTypes.string.isRequired
};
constructor(props) {
super(props);
this.handleClick = this.handleClick.bind(this);
}
isStaticColorLabel(name) {
const { alertStore } = this.props;
@@ -65,14 +59,14 @@ class BaseLabel extends Component {
return style;
}
handleClick(event) {
handleClick = event => {
event.preventDefault();
const { name, value, alertStore } = this.props;
alertStore.filters.addFilter(
FormatQuery(name, QueryOperators.Equal, value)
);
}
};
}
export { BaseLabel };