BizCharts icon indicating copy to clipboard operation
BizCharts copied to clipboard

Online demo works great with React v16.8.5, but not v17.0.2

Open gudh opened this issue 3 years ago • 12 comments

BizCharts Version: v4.1.9 (latest) Platform: Chrome 88.0.4324.96 on macOS


First of all, thanks for the amazing work!

I am new to BizCharts, so I begin my journey by trying out the demo code with create-react-app, e.g. a line chart

The demo code works great when using React.js v16.8.5, but when I upgrade React and react-dom to 17.0.2, I got error:

Invalid hook call

Xnip2021-04-01_20-41-55

gudh avatar Apr 01 '21 13:04 gudh

I have the exact same problem. Any news on this?

IbrahimDeliceUFST avatar Jun 28 '21 07:06 IbrahimDeliceUFST

me too

4nix avatar Jul 14 '21 07:07 4nix

image

unclechong avatar Aug 28 '21 15:08 unclechong

I also got this problem

wowtqt avatar Oct 08 '21 19:10 wowtqt

Any news on this?

D1M avatar Nov 12 '21 18:11 D1M

No one assigned, no labels since 1st of April 2021... No one use react 17+?

D1M avatar Nov 12 '21 18:11 D1M

Funky workaround:

$ npm uninstall bizcharts
$ yarn add bizcharts

Worked in my case.

Source

larissa-n avatar Feb 07 '22 16:02 larissa-n

Any update?

typercast avatar May 13 '22 17:05 typercast

me to @18.2.0 ...

jerrycwb avatar Jul 04 '22 11:07 jerrycwb

add dependencies in package.json

  dependencies: {
    ...
    "react-error-boundary": "3.0.2",
    "react-reconciler": "^0.25.1",
  }

qianchengjie avatar Sep 28 '22 07:09 qianchengjie

any news

nourddine-benyahya avatar Oct 28 '22 11:10 nourddine-benyahya

As @unclechong said, BizCharts depends on react-reconciler@^0.25.1 which depends on react@16, causing two versions of react to be installed (If you are using react other than 16)

After [email protected], use the overrides key in package.json to force updating the dependency version will resolve the issue.

{
  "overrides": {
    "bizcharts": {
      "react-reconciler": "0.26.2"
    }
  }
}

Be noticed I use [email protected] here since I use [email protected]. Overriding it with a higher version like [email protected] if you need react@18.

Tada!

├─┬ [email protected] overridden
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ └─┬ [email protected] overridden
│   └── [email protected] deduped

Notes, @nuintun tried to resolve this issue in https://github.com/alibaba/BizCharts/pull/1412

kitayoshi avatar Nov 11 '22 00:11 kitayoshi