From b4d15d3c5ac4542931e0f3d1b93b42109e523550 Mon Sep 17 00:00:00 2001 From: Eric Vicenti Date: Wed, 22 Jun 2016 15:08:10 -0700 Subject: [PATCH] Fix stale scene cleanup Summary: Previously we would not re-compute `this._transitionProps` after cleaning up stale scenes, so the render caused by setState still had the stale scenes in the props Reviewed By: hedgerwang Differential Revision: D3471011 fbshipit-source-id: fd08ef7a21355a229e877c85f06d6584eb44f38e --- .../NavigationExperimental/NavigationTransitioner.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Libraries/NavigationExperimental/NavigationTransitioner.js b/Libraries/NavigationExperimental/NavigationTransitioner.js index 401bd33da..1734f9b92 100644 --- a/Libraries/NavigationExperimental/NavigationTransitioner.js +++ b/Libraries/NavigationExperimental/NavigationTransitioner.js @@ -202,8 +202,14 @@ class NavigationTransitioner extends React.Component { const prevTransitionProps = this._prevTransitionProps; this._prevTransitionProps = null; - const scenes = this.state.scenes.filter(isSceneNotStale); - this.setState({ scenes }); + const nextState = { + ...this.state, + scenes: this.state.scenes.filter(isSceneNotStale), + }; + + this._transitionProps = buildTransitionProps(this.props, nextState); + + this.setState(nextState); this.props.onTransitionEnd && this.props.onTransitionEnd( this._transitionProps,