mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Add AnimatedInterpolation as possible type for toValue (#27558)
Summary: AnimatedInterpolation should be a valid type to pass to `toValue` according to the documentation. https://facebook.github.io/react-native/docs/animations#tracking-dynamic-values ## Changelog [General] [Fixed] - Add AnimationInterpolation as possible type for toValue Pull Request resolved: https://github.com/facebook/react-native/pull/27558 Test Plan: `yarn flow` works without errors. Differential Revision: D19296804 Pulled By: cpojer fbshipit-source-id: 7f09c762308c40f1eede5834fadf1837114aa397
This commit is contained in:
committed by
Facebook Github Bot
parent
d1265077d6
commit
26e8870fbf
@@ -12,6 +12,7 @@
|
||||
|
||||
const AnimatedValue = require('../nodes/AnimatedValue');
|
||||
const AnimatedValueXY = require('../nodes/AnimatedValueXY');
|
||||
const AnimatedInterpolation = require('../nodes/AnimatedInterpolation');
|
||||
const Animation = require('./Animation');
|
||||
const SpringConfig = require('../SpringConfig');
|
||||
|
||||
@@ -30,7 +31,8 @@ export type SpringAnimationConfig = AnimationConfig & {
|
||||
y: number,
|
||||
...
|
||||
}
|
||||
| AnimatedValueXY,
|
||||
| AnimatedValueXY
|
||||
| AnimatedInterpolation,
|
||||
overshootClamping?: boolean,
|
||||
restDisplacementThreshold?: number,
|
||||
restSpeedThreshold?: number,
|
||||
@@ -53,7 +55,7 @@ export type SpringAnimationConfig = AnimationConfig & {
|
||||
};
|
||||
|
||||
export type SpringAnimationConfigSingle = AnimationConfig & {
|
||||
toValue: number | AnimatedValue,
|
||||
toValue: number | AnimatedValue | AnimatedInterpolation,
|
||||
overshootClamping?: boolean,
|
||||
restDisplacementThreshold?: number,
|
||||
restSpeedThreshold?: number,
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
const AnimatedValue = require('../nodes/AnimatedValue');
|
||||
const AnimatedValueXY = require('../nodes/AnimatedValueXY');
|
||||
const AnimatedInterpolation = require('../nodes/AnimatedInterpolation');
|
||||
const Animation = require('./Animation');
|
||||
|
||||
const {shouldUseNativeDriver} = require('../NativeAnimatedHelper');
|
||||
@@ -27,7 +28,8 @@ export type TimingAnimationConfig = AnimationConfig & {
|
||||
y: number,
|
||||
...
|
||||
}
|
||||
| AnimatedValueXY,
|
||||
| AnimatedValueXY
|
||||
| AnimatedInterpolation,
|
||||
easing?: (value: number) => number,
|
||||
duration?: number,
|
||||
delay?: number,
|
||||
@@ -35,7 +37,7 @@ export type TimingAnimationConfig = AnimationConfig & {
|
||||
};
|
||||
|
||||
export type TimingAnimationConfigSingle = AnimationConfig & {
|
||||
toValue: number | AnimatedValue,
|
||||
toValue: number | AnimatedValue | AnimatedInterpolation,
|
||||
easing?: (value: number) => number,
|
||||
duration?: number,
|
||||
delay?: number,
|
||||
|
||||
Reference in New Issue
Block a user