From 38fd29022d24fd1e3453db4030444f21d6763fe5 Mon Sep 17 00:00:00 2001 From: Jan Owiesniak Date: Sun, 10 Feb 2019 13:03:23 +0100 Subject: [PATCH] Use custom view height or width if given or fallback to window --- src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 8787b6f..347cd97 100644 --- a/src/index.js +++ b/src/index.js @@ -59,8 +59,8 @@ class ParallaxScrollView extends Component { } this.state = { scrollY: new Animated.Value(0), - viewHeight: window.height, - viewWidth: window.width + viewHeight: this.props.viewHeight ? this.props.viewHeight : window.height, + viewWidth: this.props.viewWidth ? this.props.viewWidth : window.width } this.scrollY = new Animated.Value(0) this._footerComponent = { setNativeProps() { } } // Initial stub