From 6e494f93c246c3aa35fc2716155471670619e4fc Mon Sep 17 00:00:00 2001 From: Matheus Freitas Date: Mon, 13 Nov 2017 17:33:24 -0200 Subject: [PATCH] immediate close fix --- src/libraries/ViewPager/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/ViewPager/index.js b/src/libraries/ViewPager/index.js index cbd813a..e44f515 100644 --- a/src/libraries/ViewPager/index.js +++ b/src/libraries/ViewPager/index.js @@ -214,8 +214,8 @@ export default class ViewPager extends PureComponent { if (immediate) { InteractionManager.runAfterInteractions(() => { this.scroller.startScroll(this.scroller.getCurrX(), 0, finalX - this.scroller.getCurrX(), 0, 0); - this.refs['innerFlatList'].scrollToOffset({offset: finalX, animated: false}); - this.refs['innerFlatList'].recordInteraction(); + this.refs['innerFlatList'] && this.refs['innerFlatList'].scrollToOffset({offset: finalX, animated: false}); + this.refs['innerFlatList'] && this.refs['innerFlatList'].recordInteraction(); }); } else { this.scroller.startScroll(this.scroller.getCurrX(), 0, finalX - this.scroller.getCurrX(), 0, 400);