BizCharts
BizCharts copied to clipboard
Online demo works great with React v16.8.5, but not v17.0.2
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
I have the exact same problem. Any news on this?
me too
I also got this problem
Any news on this?
No one assigned, no labels since 1st of April 2021... No one use react 17+?
Any update?
me to @18.2.0 ...
add dependencies in package.json
dependencies: {
...
"react-error-boundary": "3.0.2",
"react-reconciler": "^0.25.1",
}
any news
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