We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3c9f34d commit 14e28f5Copy full SHA for 14e28f5
src/Scale.js
@@ -19,6 +19,8 @@ class Scale extends PureComponent {
19
20
const { value, initValue } = props;
21
22
+ this.interaction = null;
23
+
24
this.state = {
25
scaleValue: new Animated.Value(initValue || value),
26
};
@@ -36,8 +38,13 @@ class Scale extends PureComponent {
36
38
const { value } = this.props;
37
39
40
if (value !== nextProps.value) {
41
+ if (this.interaction) {
42
+ this.interaction.cancel();
43
+ }
44
45
if (nextProps.runAfterInteractions) {
- InteractionManager.runAfterInteractions().then(() => {
46
+ this.interaction = InteractionManager.runAfterInteractions(() => {
47
48
this.move(nextProps);
49
});
50
} else {
0 commit comments