@@ -230,9 +230,15 @@ class StackView extends React.Component<Props, State> {
230230 return < HeaderContainer { ...props } /> ;
231231 } ;
232232
233- private handleTransitionComplete = ( ) => {
233+ private handleTransitionComplete = ( {
234+ route,
235+ } : {
236+ route : NavigationRoute ;
237+ } ) => {
234238 // TODO: remove when the new event system lands
235- this . props . navigation . dispatch ( StackActions . completeTransition ( ) ) ;
239+ this . props . navigation . dispatch (
240+ StackActions . completeTransition ( { toChildKey : route . key } )
241+ ) ;
236242 } ;
237243
238244 private handleGoBack = ( { route } : { route : NavigationRoute } ) => {
@@ -243,7 +249,7 @@ class StackView extends React.Component<Props, State> {
243249 } ;
244250
245251 private handleOpenRoute = ( { route } : { route : NavigationRoute } ) => {
246- this . handleTransitionComplete ( ) ;
252+ this . handleTransitionComplete ( { route } ) ;
247253 this . setState ( state => ( {
248254 routes : state . replacing . length
249255 ? state . routes . filter ( r => ! state . replacing . includes ( r . key ) )
@@ -255,7 +261,9 @@ class StackView extends React.Component<Props, State> {
255261 } ;
256262
257263 private handleCloseRoute = ( { route } : { route : NavigationRoute } ) => {
258- this . handleTransitionComplete ( ) ;
264+ this . handleTransitionComplete ( {
265+ route : this . state . routes [ this . state . routes . length - 1 ] ,
266+ } ) ;
259267
260268 // This event will trigger when the animation for closing the route ends
261269 // In this case, we need to clean up any state tracking the route and pop it immediately
0 commit comments