reactjsprimereactreact-google-charts

PrimeReact using built in Charts and Google Charts together


I'm using primereact and react-google-charts. However, they both want me to call the components as Charts. When I write a chart, I get an error. What solution should I follow?

(https://i.sstatic.net/4qGie.png)(https://i.sstatic.net/5dpNr.png)

I tried calling the components as chart VSCode gave an error. Then I tried as Gantt and got the above error


Solution

  • you can use import aliases

    import {Chart as GoogleChart} from 'react-google-charts';
    import {Chart as PrimeChart} from 'primereact';
    

    now use GoogleChart and PrimeChart wherever you want

    <GoogleChart />
    <PrimeChart />