hustcc / echarts-for-react

⛳️ Apache ECharts components for React wrapper. 一个简单的 Apache echarts 的 React 封装。
https://git.hust.cc/echarts-for-react
MIT License
4.52k stars 630 forks source link

Support for ReactJS v18 #504

Open bpc1985 opened 2 years ago

bpc1985 commented 2 years ago

Hi, I find that in package.json

"peerDependencies": { "react": "^15.0.0 || >=16.0.0", "echarts": "^3.0.0 || ^4.0.0 || ^5.0.0" },

Do you have a plan to support ReactJS 18 ?

hustcc commented 2 years ago

Can help to test it in ReactJS 18?

fatihyildizhan commented 2 years ago

It would be great to support v18. Thanks

jocms commented 1 year ago

^

andresgutgon commented 1 year ago

We are using with React 18 without issues

LionyxML commented 1 year ago

I am on a react project with these dependencies:

  "dependencies": {
    "echarts": "^5.4.1",
    "echarts-for-react": "^3.0.2",
    "ramda": "^0.28.0",
    "react": "^18.2.0",
    "react-dom": "^18.2.0"
  },

Using Vite. For me, just a blank space is shown, nothing else.

As I was writing this I stumbled a codesandbox example that added height and width (which I think should be props with default values) directly to style. And magically my chart appeared.

        <ReactECharts option={option} style={{ width: "600px", height: "300px" }} />

It would be nice to add style to the first example on doc so newcomers might not be scratching their heads thinking why the chart is blank.