Fix transtion props `layout` in NavigationTransitioner.

Summary: When layout is measure, transtion props should be updated.

Reviewed By: ericvicenti

Differential Revision: D3479967

fbshipit-source-id: 14bcd96b9691b7ee68689393b4fef51dbd04b69f
This commit is contained in:
Hedger Wang 2016-06-24 15:25:20 -07:00 committed by Facebook Github Bot 4
parent 614f3c68e6
commit 37e41d2549
1 changed files with 7 additions and 2 deletions

View File

@ -195,7 +195,13 @@ class NavigationTransitioner extends React.Component<any, Props, State> {
layout.height.setValue(height);
layout.width.setValue(width);
this.setState({ layout });
const nextState = {
...this.state,
layout,
};
this._transitionProps = buildTransitionProps(this.props, nextState);
this.setState(nextState);
}
_onTransitionEnd(): void {
@ -208,7 +214,6 @@ class NavigationTransitioner extends React.Component<any, Props, State> {
};
this._transitionProps = buildTransitionProps(this.props, nextState);
this.setState(nextState);
this.props.onTransitionEnd && this.props.onTransitionEnd(