Typescript error: import {Chart} from 'react-chartjs-2'
See original GitHub issueHi,
I have got a working bar chart but now I would like to register a plugin using Chart.pluginService.register().
As a first step, the readme file told me to do the following import: import { Chart } from 'react-chartjs-2';
But when I try to start my application I get the following Typescript error:
error TS2305: Module (…) has no exported member ‘Chart’.
Am I missing something? Any help will be much appreciated!
Issue Analytics
- State:
- Created 6 years ago
- Comments:7
Top Results From Across the Web
Typescript error: import {Chart} from 'react-chartjs-2' · Issue #131
Hi, I have got a working bar chart but now I would like to register a plugin using Chart. ... Typescript error: import...
Read more >react-chart-js-2 in combination with TypeScript for LineCharts ...
I am currently trying to build a LineChart via react-chartjs-2. To do that I am using TypeScript ...
Read more >How to use react-chartjs-2 with TypeScript?
But occasionally types need to be set explicitly. They can be imported from Chart.js : import type { ChartData, ChartOptions } from 'chart.js';...
Read more >react-chartjs-2 - npm
Start using react-chartjs-2 in your project by running `npm i ... TypeScript icon, indicating that this package has built-in type ...
Read more >Chart.js
Chart.js provides a set of frequently used chart types, plugins, and customization options. In addition to a reasonable set of built-in ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@thr0n Thanks for reply.At last I use
const Chart = require('react-chartjs-2').Chart;
to deal with itSince
Chart
is really just passed through fromchart.js
, I solved the same problem for me by replacingwith
in my code.