I'm working on a web project with react.
How can I import only 3 Components from a library.
I have used:
import Line, Bar, Doughnut from 'react-chartjs-2';
gives an error.
import Line from 'react-chartjs-2';
import Bar from 'react-chartjs-2';
import Doughnut from 'react-chartjs-2';
makes all Line, Bar and Doughnut elements act as Doughnut elements.
Using
import {Line, Bar, Doughnut} from 'react-chartjs-2';
loads the whole library, which is something I don't want.
NOTE: I use that import in multiple files.