Reputation: 1475
In a module's documentation, it says I should import a component by:
var LineChart = require("react-chartjs").Line;
What would be the translation of this be using import
in Babel? The .Line
is the confusing part for me.
Upvotes: 0
Views: 258
Reputation: 664620
You would write
import { Line as LineChart } from 'react-chartjs';
Upvotes: 1
Reputation: 36511
The Babel module import
equivalent would be:
import { Line } from 'react-chartjs';
Upvotes: 3