From 9d1f15e85cbba48d743087163a611caab9258027 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Tue, 31 Jul 2018 14:26:57 +0200 Subject: [PATCH] refactor(ui): use new style method definition to avoid bind() calls in constructor --- ui/src/Components/Labels/BaseLabel/index.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/ui/src/Components/Labels/BaseLabel/index.js b/ui/src/Components/Labels/BaseLabel/index.js index 40ecdfc14..3f6f79138 100644 --- a/ui/src/Components/Labels/BaseLabel/index.js +++ b/ui/src/Components/Labels/BaseLabel/index.js @@ -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 };