From bdf253992c52e32b67eb1bb2f4d1ee3ceb13c7ab Mon Sep 17 00:00:00 2001 From: Marc Schipperheyn Date: Mon, 22 Jun 2020 03:23:51 -0300 Subject: [PATCH] fix NaN on mount (#1193) --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 71de43a6..da429c2a 100644 --- a/src/index.js +++ b/src/index.js @@ -464,7 +464,7 @@ export default class extends Component { if (!this.internals.offset) // Android not setting this onLayout first? https://github.com/leecade/react-native-swiper/issues/582 this.internals.offset = {} - const diff = offset[dir] - this.internals.offset[dir] + const diff = offset[dir] - (this.internals.offset[dir] || 0) const step = dir === 'x' ? state.width : state.height let loopJump = false