I found some solutions on google:
And one of the solution resolved the issue:
This is because the es6 compile folder’s index.js imports types that are not left in the actual files after compilation.
A temporary hack is to use the src
folder directly for TypeScript, or the umd
version for JS.
So instead of:
import { Area } from “recharts”;
JS users should use:
import * as Recharts from “recharts/umd/Recharts”;
const Area = Recharts.Area;
For us:
import { ResponsiveContainer, LineChart, Line, CartesianGrid, XAxis, YAxis } from ‘recharts/umd/Recharts’;