Skip to content

Commit 5a0012e

Browse files
cmcewenfacebook-github-bot
authored andcommitted
Export Animated.Interpolation
Summary: Flow was complaining about an interpolated value I created in a class constructor, and I realized there was no way to properly import the `AnimatedInterpolation` class type. This allows for using `Animated.Interpolation` as a type to match `Animated.Value` Closes facebook#9360 Differential Revision: D4538770 Pulled By: lacker fbshipit-source-id: 49da2374f2d73ad3d667dafaa6338b77b9aec8a8
1 parent d649dd0 commit 5a0012e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Libraries/Animated/src/AnimatedImplementation.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,9 +1090,6 @@ class AnimatedInterpolation extends AnimatedWithChildren {
10901090
typeof parentValue === 'number',
10911091
'Cannot interpolate an input which is not a number.'
10921092
);
1093-
/* $FlowFixMe(>=0.36.0 site=react_native_fb,react_native_oss) Flow error
1094-
* detected during the deploy of Flow v0.36.0. To see the error, remove
1095-
* this comment and run Flow */
10961093
return this._interpolation(parentValue);
10971094
}
10981095
@@ -1109,7 +1106,7 @@ class AnimatedInterpolation extends AnimatedWithChildren {
11091106
super.__detach();
11101107
}
11111108
1112-
__transformDataType(range) {
1109+
__transformDataType(range: Array<any>) {
11131110
// Change the string array type to number array
11141111
// So we can reuse the same logic in iOS and Android platform
11151112
return range.map(function (value) {
@@ -2377,6 +2374,10 @@ module.exports = {
23772374
* 2D value class for driving 2D animations, such as pan gestures.
23782375
*/
23792376
ValueXY: AnimatedValueXY,
2377+
/**
2378+
* exported to use the Interpolation type in flow
2379+
*/
2380+
Interpolation: AnimatedInterpolation,
23802381

23812382
/**
23822383
* Animates a value from an initial velocity to zero based on a decay

0 commit comments

Comments
 (0)