From e25bbbff2fc3b28b5264e39545d499624eb4ea16 Mon Sep 17 00:00:00 2001 From: Jani Evakallio Date: Mon, 6 Jul 2015 17:07:47 +0100 Subject: [PATCH] Keep hidden nav content item hidden after tween completion --- components/NavBarContent.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/NavBarContent.js b/components/NavBarContent.js index 243f251..d215f50 100644 --- a/components/NavBarContent.js +++ b/components/NavBarContent.js @@ -23,16 +23,19 @@ var NavBarContent = React.createClass({ }, componentWillReceiveProps: function(newProps) { + var beginOpacity = this.props.willDisappear ? 1 : 0; + var endOpacity = this.props.willDisappear ? 0 : 1; + if (newProps.route !== this.props.route) { this.setState({ - opacity: this.props.willDisappear ? 1 : 0 + opacity: beginOpacity }); setTimeout(() => { this.tweenState('opacity', { easing: tweenState.easingTypes.easeInOutQuad, duration: 200, - endValue: 1 + endValue: endOpacity }); }, 0); }