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
This commit is contained in:
Eric Vicenti 2016-06-22 15:08:10 -07:00 committed by Facebook Github Bot
parent d464f1d1c2
commit b4d15d3c5a
1 changed files with 8 additions and 2 deletions

View File

@ -202,8 +202,14 @@ class NavigationTransitioner extends React.Component<any, Props, State> {
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,