Skip to content

Commit

Permalink
Fix stale scene cleanup
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Eric Vicenti authored and Facebook Github Bot committed Jun 22, 2016
1 parent d464f1d commit b4d15d3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Libraries/NavigationExperimental/NavigationTransitioner.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit b4d15d3

Please sign in to comment.