@react-navigation/native-stack 7.1.5 → 7.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,8 +17,8 @@ import { processFonts } from './FontProcessor';
17
17
  type Props = NativeStackNavigationOptions & {
18
18
  headerTopInsetEnabled: boolean;
19
19
  headerHeight: number;
20
+ headerBack: { title?: string | undefined; href: undefined } | undefined;
20
21
  route: Route<string>;
21
- canGoBack: boolean;
22
22
  };
23
23
 
24
24
  export function useHeaderConfigProps({
@@ -46,9 +46,9 @@ export function useHeaderConfigProps({
46
46
  headerTransparent,
47
47
  headerSearchBarOptions,
48
48
  headerTopInsetEnabled,
49
+ headerBack,
49
50
  route,
50
51
  title,
51
- canGoBack,
52
52
  }: Props) {
53
53
  const { direction } = useLocale();
54
54
  const { colors, fonts } = useTheme();
@@ -124,17 +124,21 @@ export function useHeaderConfigProps({
124
124
  ? 'transparent'
125
125
  : colors.card);
126
126
 
127
+ const canGoBack = headerBack != null;
128
+
127
129
  const headerLeftElement = headerLeft?.({
128
130
  tintColor,
129
131
  canGoBack,
130
- label: headerBackTitle,
132
+ label: headerBackTitle ?? headerBack?.title,
131
133
  // `href` is only applicable to web
132
134
  href: undefined,
133
135
  });
136
+
134
137
  const headerRightElement = headerRight?.({
135
138
  tintColor,
136
139
  canGoBack,
137
140
  });
141
+
138
142
  const headerTitleElement =
139
143
  typeof headerTitle === 'function'
140
144
  ? headerTitle({