Skip to content

Commit

Permalink
Fix PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
alexwizp committed Aug 28, 2019
1 parent 1eb9a6d commit 6c17fb8
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import React, { useEffect, createRef } from 'react';
import React, { useEffect, useRef } from 'react';
import PropTypes from 'prop-types';

import {
Expand Down Expand Up @@ -72,7 +72,7 @@ export const TimeSeries = ({
annotations,
enableHistogramMode,
}) => {
const chartRef = createRef();
const chartRef = useRef();
const updateCursor = (_, cursor) => {
if (chartRef.current) {
chartRef.current.dispatchExternalCursorEvent(cursor);
Expand All @@ -83,7 +83,7 @@ export const TimeSeries = ({
eventBus.on(ACTIVE_CURSOR, updateCursor);

return () => {
eventBus.off(ACTIVE_CURSOR);
eventBus.off(ACTIVE_CURSOR, undefined, updateCursor);
};
}, []); // eslint-disable-line

Expand All @@ -108,6 +108,7 @@ export const TimeSeries = ({
}}
baseTheme={isDarkMode ? DARK_THEME : LIGHT_THEME}
tooltip={{
snap: true,
type: TooltipType.VerticalCursor,
headerFormatter: tooltipFormatter,
}}
Expand Down

0 comments on commit 6c17fb8

Please sign in to comment.