Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

return destroy from useEffect

Blue Mouseaf6000b1cbb5
diff --git a/src/ui/Chart.jsx b/src/ui/Chart.jsx
index c1313d141..9643d4f81 100644
--- a/src/ui/Chart.jsx
+++ b/src/ui/Chart.jsx
@@ -11,7 +11,7 @@ const Chart = ({ current, children, options }) => {
try {
chartInstance.destroy()
} catch (error) {
- console.error('Internal billboard.js error', error)
+ console.error('[ERROR] Internal billboard.js error', error)
} finally {
chartInstance = null
}
@@ -29,8 +29,7 @@ const Chart = ({ current, children, options }) => {
useEffect(() => {
renderChart()
-
- return () => { destroy() }
+ return destroy
})
return (