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 James Ide
parent c412d2506f
commit 0a2ef025fa

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(