diff --git a/src/components/HeaderWithBackButton.js b/src/components/HeaderWithBackButton.js index e82251542987..c612b82851f9 100755 --- a/src/components/HeaderWithBackButton.js +++ b/src/components/HeaderWithBackButton.js @@ -120,8 +120,8 @@ const defaultProps = { title: '', subtitle: '', onDownloadButtonPress: () => {}, - onBackButtonPress: Navigation.goBack, - onCloseButtonPress: Navigation.dismissModal, + onBackButtonPress: () => Navigation.goBack(), + onCloseButtonPress: () => Navigation.dismissModal(), onThreeDotsButtonPress: () => {}, shouldShowBorderBottom: false, shouldShowDownloadButton: false, diff --git a/src/libs/Navigation/Navigation.js b/src/libs/Navigation/Navigation.js index 952faaf9a6b7..167f2d9eea96 100644 --- a/src/libs/Navigation/Navigation.js +++ b/src/libs/Navigation/Navigation.js @@ -136,7 +136,7 @@ function dismissModal(targetReportID) { action.type = 'REPLACE'; navigationRef.current.dispatch(action); } else { - navigationRef.current.dispatch(StackActions.pop()); + navigationRef.current.dispatch({...StackActions.pop(), target: rootState.key}); } } else { Log.hmmm('[Navigation] dismissModal failed because there is no modal stack to dismiss');