From 0a2ef025faf025f351436f7a2316c2177ee4a932 Mon Sep 17 00:00:00 2001 From: Hedger Wang Date: Fri, 24 Jun 2016 15:25:20 -0700 Subject: [PATCH] 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 --- .../NavigationExperimental/NavigationTransitioner.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Libraries/NavigationExperimental/NavigationTransitioner.js b/Libraries/NavigationExperimental/NavigationTransitioner.js index 1734f9b92d8bda..7282922001e980 100644 --- a/Libraries/NavigationExperimental/NavigationTransitioner.js +++ b/Libraries/NavigationExperimental/NavigationTransitioner.js @@ -195,7 +195,13 @@ class NavigationTransitioner extends React.Component { 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 { }; this._transitionProps = buildTransitionProps(this.props, nextState); - this.setState(nextState); this.props.onTransitionEnd && this.props.onTransitionEnd(