Pārlūkot izejas kodu

unregister event listener correctly

Erik Sundell 7 gadi atpakaļ
vecāks
revīzija
d51f91f54b

+ 2 - 2
public/app/plugins/datasource/stackdriver/components/QueryEditor.tsx

@@ -62,8 +62,8 @@ export class QueryEditor extends React.Component<Props, State> {
   }
 
   componentWillUnmount() {
-    this.props.events.off('data-received');
-    this.props.events.off('data-error');
+    this.props.events.off('data-received', this.onDataReceived);
+    this.props.events.off('data-error', this.onDataError);
   }
 
   onDataReceived(dataList) {