Page MenuHomePhabricator

[native] Fix reanimated cancelAnimation flow type
ClosedPublic

Authored by angelika on Wed, Dec 11, 6:58 AM.
Tags
None
Referenced Files
F3508535: D14098.id46497.diff
Fri, Dec 20, 10:48 PM
F3508513: D14098.id46398.diff
Fri, Dec 20, 10:37 PM
F3508507: D14098.id46316.diff
Fri, Dec 20, 10:35 PM
F3507438: D14098.id.diff
Fri, Dec 20, 8:50 PM
F3507264: D14098.diff
Fri, Dec 20, 8:03 PM
F3507238: D14098.id46399.diff
Fri, Dec 20, 7:55 PM
F3504880: D14098.id46461.diff
Fri, Dec 20, 11:01 AM
F3499884: D14098.id46316.diff
Fri, Dec 20, 12:26 AM
Subscribers
None

Details

Summary

I found a mistake in CancelAnimation flow type. It makes no sense it takes a number as an argument and in original ts types it takes a SharedValue: https://github.com/software-mansion/react-native-reanimated/blob/2.17.0/src/reanimated2/animation/util.ts#L281. I fixed it because I'll need this in later diff.

Test Plan

Flow and swipe a message.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

angelika held this revision as a draft.

Thanks for finding this. Just wondering – did you find out because something was broken through testing, or because you observed that Flow was printing an error when the code looked right?

This revision is now accepted and ready to land.Wed, Dec 11, 5:02 PM

Thanks for finding this. Just wondering – did you find out because something was broken through testing, or because you observed that Flow was printing an error when the code looked right?

It went like this:

  • I used cancelAnimation without .value
  • Flow raised an error
  • I investigated it and found out the type was not right
  • Flow complained again in swipeable-message.react.js
  • I fixed it there and tested in the app to make sure nothing is broken

Rebase and address feedback