From 4703bb897450da4e8b14ab461abe70ed9a694be1 Mon Sep 17 00:00:00 2001 From: FacuM Date: Sun, 19 May 2024 23:02:50 -0300 Subject: [PATCH] Fix read on `undefined` if `animateOnDataChange` is `true` --- src/LineChart/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/LineChart/index.ts b/src/LineChart/index.ts index 6342558..de804ef 100644 --- a/src/LineChart/index.ts +++ b/src/LineChart/index.ts @@ -462,6 +462,8 @@ export const useLineChart = (props: extendedLineChartPropsType) => { if (animateOnDataChange && animations) { animations.forEach((item, index) => { item.addListener((val) => { + if (typeof data[index] === 'undefined') { return; } + const temp = data[index]?.value ?? 0 data[index].value = val.value let pp = ''