6

I got this error when I use react-apexchart in Typescript. Does any one know why this happens?

/Users/apple/Downloads/stake-governance/src/components/chart/AreaChart.tsx
    TypeScript error in /Users/apple/chartapp/src/components/chart/AreaChart.tsx(113,10):
    'ReactApexChart' cannot be used as a JSX component.
      Its instance type 'ReactApexChart' is not a valid JSX element.
        The types returned by 'render()' are incompatible between these types.
          Type 'React.ReactNode' is not assignable to type 'import("/Users/apple/Downloads/stake-governance/node_modules/@types/react-dom/node_modules/@types/react/index").ReactNode'.
            Type '{}' is not assignable to type 'ReactNode'.
              Type '{}' is missing the following properties from type 'ReactPortal': key, children, type, props  TS2786
    
        111 |     <div className={cx('area-chart')}>
        112 |       <div id="chart" style={{ height: 480 }}>
      > 113 |         <ReactApexChart 
            |          ^
        114 |           options={option} 
        115 |           series={series} 
        116 |           width="100%"
Chris
  • 159
  • 1
  • 2
  • 9

0 Answers0