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:
parent
d464f1d1c2
commit
b4d15d3c5a
|
@ -202,8 +202,14 @@ class NavigationTransitioner extends React.Component<any, Props, State> {
|
||||||
const prevTransitionProps = this._prevTransitionProps;
|
const prevTransitionProps = this._prevTransitionProps;
|
||||||
this._prevTransitionProps = null;
|
this._prevTransitionProps = null;
|
||||||
|
|
||||||
const scenes = this.state.scenes.filter(isSceneNotStale);
|
const nextState = {
|
||||||
this.setState({ scenes });
|
...this.state,
|
||||||
|
scenes: this.state.scenes.filter(isSceneNotStale),
|
||||||
|
};
|
||||||
|
|
||||||
|
this._transitionProps = buildTransitionProps(this.props, nextState);
|
||||||
|
|
||||||
|
this.setState(nextState);
|
||||||
|
|
||||||
this.props.onTransitionEnd && this.props.onTransitionEnd(
|
this.props.onTransitionEnd && this.props.onTransitionEnd(
|
||||||
this._transitionProps,
|
this._transitionProps,
|
||||||
|
|
Loading…
Reference in New Issue