-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
adds type checking to Animated toValue and iterations key values to m… #23812
adds type checking to Animated toValue and iterations key values to m… #23812
Conversation
…ake sure Android does not crash from bad params when using useNativeDriver
Should we show a warning in dev mode when this is the case? It a user has a bug in their JS, they may get confused when zeroes end up getting used silently. |
My motivation for fixing this is that the JS bug is in one of possibly 100 different dependency libraries. Showing a warning might help focus attention on which library is the culprit or where in the internal project code the developer went awry. On the other hand, it might be another yellow box warning that gets silenced because the 3rd party lib is unsupported and the developer is tired of getting nagged about it. Personally, I would probably want to see a warning and have the option of silencing it or fixing the library. |
The JavaScript animated version does not show a yellow box warning if you supply an invalid type. i.e.
So to maintain parity between JS and native it would be best to not show a yellow box. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cpojer is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
This pull request was successfully merged by @andrewschenk-linx in 25d3976. When will my fix make it into a release? | Upcoming Releases |
…ake sure Android does not crash from bad params when using useNativeDriver
Summary
Android apps crash when using Animated useNativeDriver: true and the toValue is not a number. See issue here with test case. Issue
Changelog
[Android] [fixed] - Fix crash when using Animated with useNativeDriver and a non Number toValue
Test Plan
Run Snack code with patched React Native core. Malformed parameters will no longer crash Android app.