Skip to content
This repository was archived by the owner on Feb 8, 2020. It is now read-only.

Commit 77f29d3

Browse files
phamfoosatya164
authored andcommitted
feat: add headerBackTitleVisible to navigation options in native stack
1 parent 5a34764 commit 77f29d3

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

packages/native-stack/src/types.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,13 @@ export type NativeStackNavigationOptions = {
6565
* @platform ios
6666
*/
6767
headerBackTitle?: string;
68+
/**
69+
* Whether the back button title should be visible or not. Defaults to `true`.
70+
* Only supported on iOS.
71+
*
72+
* @platform ios
73+
*/
74+
headerBackTitleVisible?: boolean;
6875
/**
6976
* Whether to show the header.
7077
*/

packages/native-stack/src/views/HeaderConfig.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export default function HeaderConfig(props: Props) {
2020
headerRight,
2121
headerTitle,
2222
headerBackTitle,
23+
headerBackTitleVisible = true,
2324
headerHideBackButton,
2425
headerHideShadow,
2526
headerTintColor,
@@ -53,7 +54,7 @@ export default function HeaderConfig(props: Props) {
5354
? headerTitleStyle.color
5455
: headerTintColor
5556
}
56-
backTitle={headerBackTitle}
57+
backTitle={headerBackTitleVisible ? headerBackTitle : ''}
5758
backTitleFontFamily={headerBackTitleStyle.fontFamily}
5859
backTitleFontSize={headerBackTitleStyle.fontSize}
5960
color={headerTintColor}

0 commit comments

Comments
 (0)