Skip to content

Commit

Permalink
Merge pull request #9 from FacuM/bug-read-on-undefined
Browse files Browse the repository at this point in the history
Fix read on `undefined` if `animateOnDataChange` is `true`
  • Loading branch information
Abhinandan-Kushwaha authored Jul 8, 2024
2 parents c1a4e0f + 4703bb8 commit 4fcbcd0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/LineChart/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,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 ?? 0
let pp = ''
Expand Down

0 comments on commit 4fcbcd0

Please sign in to comment.