This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Class List extends Component { | |
state = { | |
data : [] | |
} | |
// use this on your API response section only | |
this.setState({ | |
data : response.data // this will be you receiving data in array path | |
}) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import ReactDOM from "react-dom"; | |
import { Pie } from 'react-chartjs-2' | |
import useWindowSize from "./get-window-side-hot-refresh"; | |
function PieChart() { | |
const size = useWindowSize(); | |
return ( | |
<React.Fragment> |