From adee8595d3afa9ed00aa7b794645a6be33e7bd74 Mon Sep 17 00:00:00 2001 From: Li Zheng Date: Mon, 4 Sep 2017 15:46:54 +0800 Subject: [PATCH] Actually fix `Uncaught TypeError: _this.refs.scrollView.scrollTo is not a function` when using https://github.com/flyskywhy/react-web --- src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index cd46e7a2..2595be61 100644 --- a/src/index.js +++ b/src/index.js @@ -419,7 +419,7 @@ export default class extends Component { if (state.dir === 'x') x = diff * state.width if (state.dir === 'y') y = diff * state.height - if (Platform.OS === 'android') { + if (Platform.OS !== 'ios') { this.scrollView && this.scrollView[animated ? 'setPage' : 'setPageWithoutAnimation'](diff) } else { this.scrollView && this.scrollView.scrollTo({ x, y, animated }) @@ -432,7 +432,7 @@ export default class extends Component { }) // trigger onScrollEnd manually in android - if (!animated || Platform.OS === 'android') { + if (!animated || Platform.OS !== 'ios') { setImmediate(() => { this.onScrollEnd({ nativeEvent: {