From 14269ff8eb5224104dcac42fa644ebc1a3c00485 Mon Sep 17 00:00:00 2001 From: Pavlo Aksonov Date: Thu, 13 Sep 2018 15:31:15 +0200 Subject: [PATCH] allow to hide back button by providing left={()=>null} --- src/navigationStore.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/navigationStore.js b/src/navigationStore.js index 45edbf540..9101da282 100644 --- a/src/navigationStore.js +++ b/src/navigationStore.js @@ -297,12 +297,14 @@ function createNavigationOptions(params) { || navigationParams.backTitle || ((drawerImage || drawerIcon) && !hideDrawerButton && drawerPosition !== 'right') ) { - res.headerLeft = getValue(navigationParams.left || navigationParams.leftButton || params.renderLeftButton, { ...params, ...navigationParams, ...screenProps }) + const leftButton = navigationParams.left || navigationParams.leftButton || params.renderLeftButton; + res.headerLeft = getValue(leftButton, { ...params, ...navigationParams, ...screenProps }) || (((onLeft && (leftTitle || navigationParams.leftTitle || leftButtonImage || navigationParams.leftButtonImage)) || drawerImage || drawerIcon) && ( )) || res.headerLeft - || (init ? null : (renderBackButton && renderBackButton(state)) || ); + || (init ? null : (!leftButton && renderBackButton && renderBackButton(state)) || (!leftButton && )) + || null; } if (back) {