Skip to content

Commit d242aa4

Browse files
authored
Merge pull request ascoders#389 from radeno/patch-1
Add compatibility with RN 0.62
2 parents c537143 + 4fa10a0 commit d242aa4

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

Diff for: src/image-viewer.component.tsx

+10-5
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ export default class ImageViewer extends React.Component<Props, State> {
6969
// 显示动画
7070
Animated.timing(this.fadeAnim, {
7171
toValue: 1,
72-
duration: 200
72+
duration: 200,
73+
useNativeDriver: false
7374
}).start();
7475
}
7576
}
@@ -109,7 +110,8 @@ export default class ImageViewer extends React.Component<Props, State> {
109110
// 显示动画
110111
Animated.timing(this.fadeAnim, {
111112
toValue: 1,
112-
duration: 200
113+
duration: 200,
114+
useNativeDriver: false
113115
}).start();
114116
}
115117
);
@@ -304,7 +306,8 @@ export default class ImageViewer extends React.Component<Props, State> {
304306
this.standardPositionX = this.positionXNumber;
305307
Animated.timing(this.positionX, {
306308
toValue: this.positionXNumber,
307-
duration: this.props.pageAnimateTime
309+
duration: this.props.pageAnimateTime,
310+
useNativeDriver: false
308311
}).start();
309312

310313
const nextIndex = (this.state.currentShowIndex || 0) - 1;
@@ -337,7 +340,8 @@ export default class ImageViewer extends React.Component<Props, State> {
337340
this.standardPositionX = this.positionXNumber;
338341
Animated.timing(this.positionX, {
339342
toValue: this.positionXNumber,
340-
duration: this.props.pageAnimateTime
343+
duration: this.props.pageAnimateTime,
344+
useNativeDriver: false
341345
}).start();
342346

343347
const nextIndex = (this.state.currentShowIndex || 0) + 1;
@@ -361,7 +365,8 @@ export default class ImageViewer extends React.Component<Props, State> {
361365
this.positionXNumber = this.standardPositionX;
362366
Animated.timing(this.positionX, {
363367
toValue: this.standardPositionX,
364-
duration: 150
368+
duration: 150,
369+
useNativeDriver: false
365370
}).start();
366371
}
367372

0 commit comments

Comments
 (0)