I want to use react-apexcharts in astro (in a preact component actually)
here is my jsx component
import { useState } from "preact/hooks";
import Chart from "react-apexcharts";
const MyChartComponent = () => {
const options = { labels: ["Cases", "Recovered", "Deaths"] };
const [dataSeries, setDataSeries] = useState([14, 97, 5]);
function update() {
console.log("hey");
setDataSeries([Math.random(), Math.random(), Math.random()]);
}
return (
<div className="app">
<div className="row">
<div className="mixed-chart">
<Chart
options={options}
series={dataSeries}
type="donut"
width="300"
/>
</div>
</div>
<button onClick={update}>Update</button>
</div>
);
};
export default MyChartComponent;
I am getting the error shown in the attached image