Skip to content

Commit

Permalink
chartjs.register doesn't take a variadic expansion seemingly and usee…
Browse files Browse the repository at this point in the history
…ffect loads after component mount anyway
  • Loading branch information
aetaric committed Oct 9, 2024
1 parent 8ab30d2 commit cbeea1e
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions webserver/src/components/Stats.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ export default function Stats() {

ChartJS.register(ArcElement, Tooltip, Legend, CategoryScale, LinearScale, PointElement, LineElement, Title);

useEffect(() => {
const chartComponents = [ArcElement, Tooltip, Legend, CategoryScale, LinearScale, PointElement, LineElement, Title];
ChartJS.register(...chartComponents);
return () => ChartJS.unregister(...chartComponents);
}, []);

function fetchData() {
http.get('./api/stats/current')
.then(stats => {
Expand Down

0 comments on commit cbeea1e

Please sign in to comment.