Improve performance of highlightCallback

pull/10616/head
Andrew Watkins 2017-12-04 15:21:14 -08:00
parent de302999fa
commit 1692a754a2
1 changed files with 3 additions and 3 deletions

View File

@ -355,7 +355,8 @@ export default class Dygraph extends Component {
} }
highlightCallback = ({pageX}) => { highlightCallback = ({pageX}) => {
this.setState({isHidden: false, pageX}) this.pageX = pageX
this.setState({isHidden: false})
} }
legendFormatter = legend => { legendFormatter = legend => {
@ -381,7 +382,6 @@ export default class Dygraph extends Component {
render() { render() {
const { const {
legend, legend,
pageX,
sortType, sortType,
isHidden, isHidden,
isSnipped, isSnipped,
@ -396,7 +396,7 @@ export default class Dygraph extends Component {
{...legend} {...legend}
graph={this.graphRef} graph={this.graphRef}
legend={this.legendRef} legend={this.legendRef}
pageX={pageX} pageX={this.pageX}
sortType={sortType} sortType={sortType}
onHide={this.handleHideLegend} onHide={this.handleHideLegend}
isHidden={isHidden} isHidden={isHidden}