whawker / react-jsx-highcharts

Highcharts built with proper React components

Home Page:https://whawker.github.io/react-jsx-highcharts/examples

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

State loss on onAfterSetExtremes

muhaimincs opened this issue · comments

Bug or Feature Request?

Bug

Description

I try to set a component state upon onAfterSetExtremes

How to reproduce

const afterSetExtremes = (e) => {
    if (isNumber(e.min) && isNumber(e.max)) {
      const minDt = new Date(e.min);
      const maxDt = new Date(e.max);
      setPrintingState({
        startDate: format(minDt, 'yyyyMMdd'),
        endDate: format(maxDt, 'yyyyMMdd'),
      });
    }
  };

Live demo demonstrating bug

Versions

  • React JSX Highcharts version: 4.0.1
  • Highcharts version: 8.1.0
  • React version: 16.13.1

close due to my mistake