Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix read on undefined if animateOnDataChange is true #9

Merged

Conversation

FacuM
Copy link
Contributor

@FacuM FacuM commented May 20, 2024

The feature animateOnDataChange wants to know whether new data is available. However, while doing so, it attempts to read from an undefined object if there's, in fact, nothing new to read.

This patch fixes this bug by breaking out of the event listener if an undefined array element is found.

For an example, check the screenshot below:

image

Here's the call stack:

item.addListener$argument_0
   node_modules/gifted-charts-core/src/LineChart/index.ts:468:21
__callListeners
   node_modules/react-native-web/dist/vendor/react-native/Animated/nodes/AnimatedNode.js:119:9
__callListeners
   node_modules/react-native-web/dist/vendor/react-native/Animated/nodes/AnimatedWithChildren.js:63:7
__getNativeConfig
   node_modules/react-native-web/dist/vendor/react-native/Animated/nodes/AnimatedValue.js:260:3
animation.start$argument_2
   node_modules/react-native-web/dist/vendor/react-native/Animated/nodes/AnimatedValue.js:225:12
onUpdate
   node_modules/react-native-web/dist/vendor/react-native/Animated/animations/TimingAnimation.js:102:7

@Abhinandan-Kushwaha
Copy link
Owner

Thanks for this PR @FacuM

@Abhinandan-Kushwaha Abhinandan-Kushwaha merged commit 4fcbcd0 into Abhinandan-Kushwaha:main Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants