Open History to see the last commit
1diff --git a/lib/module/views/NativeStackView.native.js b/lib/module/views/NativeStackView.native.js
2index c342e90bffde9ad5044b6167bdde2e19be219270..5d3e4407aa1bb68b873cf164adf5a9f0b487bb0b 100644
3--- a/lib/module/views/NativeStackView.native.js
4+++ b/lib/module/views/NativeStackView.native.js
5@@ -370,6 +370,17 @@ export function NativeStackView({
6 return /*#__PURE__*/_jsx(SafeAreaProviderCompat, {
7 children: /*#__PURE__*/_jsx(ScreenStack, {
8 style: styles.container,
9+ onFinishTransitioning: () => {
10+ // Surface UIKit's transition-completion callback to every route of
11+ // this navigator. Unlike transitionEnd, this also fires when a modal
12+ // finishes dismissing — where the presenting screen below receives no
13+ // appearance callbacks — and for a gesture-driven dismissal it fires
14+ // before the state pop, while the modal route is still the focused
15+ // one, so the event must not be targeted at a single route.
16+ navigation.emit({
17+ type: 'finishTransitioning'
18+ });
19+ },
20 children: state.routes.concat(state.preloadedRoutes).map((route, index) => {
21 const descriptor = descriptors[route.key] ?? preloadedDescriptors[route.key];
22 const isFocused = state.index === index;
23diff --git a/lib/module/views/useHeaderConfigProps.js b/lib/module/views/useHeaderConfigProps.js
24index 9c21aa48cb580704aa17e59d9cdadcc612a1e4ff..a1b3a38368c5ef2257570f382e87df5d6f55b11e 100644
25--- a/lib/module/views/useHeaderConfigProps.js
26+++ b/lib/module/views/useHeaderConfigProps.js
27@@ -19,6 +19,12 @@ const processBarButtonItems = (items, colors, fonts) => {
28 }
29 return item;
30 }
31+ if (item.type === 'mailSearchToolbar') {
32+ return {
33+ ...item,
34+ index
35+ };
36+ }
37 if (item.type === 'button' || item.type === 'menu') {
38 if (item.type === 'menu' && item.menu == null) {
39 throw new Error(`Menu item must have a 'menu' property defined: ${JSON.stringify(item)}`);
40@@ -79,7 +85,7 @@ const processBarButtonItems = (items, colors, fonts) => {
41 }
42 return processedItem;
43 }
44- throw new Error(`Invalid item type: ${JSON.stringify(item)}. Valid types are 'button', 'menu', 'custom' and 'spacing'.`);
45+ throw new Error(`Invalid item type: ${JSON.stringify(item)}. Valid types are 'button', 'menu', 'custom', 'spacing' and 'mailSearchToolbar'.`);
46 }).filter(item => item != null);
47 };
48 const transformIcon = icon => {
49@@ -158,8 +164,12 @@ export function useHeaderConfigProps({
50 headerBack,
51 route,
52 title,
53+ unstable_headerCenterItems: headerCenterItems,
54 unstable_headerLeftItems: headerLeftItems,
55- unstable_headerRightItems: headerRightItems
56+ unstable_headerRightItems: headerRightItems,
57+ unstable_headerSubtitle: headerSubtitle,
58+ unstable_headerToolbarItems: headerToolbarItems,
59+ unstable_navigationItemStyle: navigationItemStyle
60 }) {
61 const {
62 direction
63@@ -255,6 +265,10 @@ export function useHeaderConfigProps({
64 tintColor,
65 canGoBack
66 });
67+ const centerItems = headerCenterItems?.({
68+ tintColor,
69+ canGoBack
70+ });
71 let rightItems = headerRightItems?.({
72 tintColor,
73 canGoBack
74@@ -264,6 +278,10 @@ export function useHeaderConfigProps({
75 // So we need to reverse them here to match the order
76 rightItems = [...rightItems].reverse();
77 }
78+ const toolbarItems = headerToolbarItems?.({
79+ tintColor,
80+ canGoBack
81+ });
82 const children = /*#__PURE__*/_jsxs(_Fragment, {
83 children: [Platform.OS === 'ios' ? /*#__PURE__*/_jsxs(_Fragment, {
84 children: [leftItems ? leftItems.map((item, index) => {
85@@ -272,13 +290,23 @@ export function useHeaderConfigProps({
86 // eslint-disable-next-line @eslint-react/no-array-index-key
87 , {
88 hidesSharedBackground: item.hidesSharedBackground,
89+ identifier: item.identifier,
90 children: item.element
91 }, index);
92 }
93 return null;
94 }) : headerLeftElement != null ? /*#__PURE__*/_jsx(ScreenStackHeaderLeftView, {
95 children: headerLeftElement
96- }) : null, headerTitleElement != null ? /*#__PURE__*/_jsx(ScreenStackHeaderCenterView, {
97+ }) : null, centerItems ? centerItems.map((item, index) => {
98+ if (item.type === 'custom') {
99+ return /*#__PURE__*/_jsx(ScreenStackHeaderCenterView, {
100+ hidesSharedBackground: item.hidesSharedBackground,
101+ identifier: item.identifier,
102+ children: item.element
103+ }, index);
104+ }
105+ return null;
106+ }) : headerTitleElement != null ? /*#__PURE__*/_jsx(ScreenStackHeaderCenterView, {
107 children: headerTitleElement
108 }) : null]
109 }) : /*#__PURE__*/_jsxs(_Fragment, {
110@@ -321,6 +349,7 @@ export function useHeaderConfigProps({
111 // eslint-disable-next-line @eslint-react/no-array-index-key
112 , {
113 hidesSharedBackground: item.hidesSharedBackground,
114+ identifier: item.identifier,
115 children: item.element
116 }, index);
117 }
118@@ -356,6 +385,7 @@ export function useHeaderConfigProps({
119 largeTitleFontWeight,
120 largeTitleHideShadow: headerLargeTitleShadowVisible === false,
121 title: titleText,
122+ subtitle: headerSubtitle,
123 titleColor,
124 titleFontFamily,
125 titleFontSize,
126@@ -364,6 +394,9 @@ export function useHeaderConfigProps({
127 disableTopInsetApplication: !headerTopInsetEnabled,
128 translucent: translucent === true,
129 children,
130+ navigationItemStyle,
131+ headerToolbarItems: processBarButtonItems(toolbarItems, colors, fonts),
132+ headerCenterBarButtonItems: processBarButtonItems(centerItems, colors, fonts),
133 headerLeftBarButtonItems: processBarButtonItems(leftItems, colors, fonts),
134 headerRightBarButtonItems: processBarButtonItems(rightItems, colors, fonts),
135 experimental_userInterfaceStyle: dark ? 'dark' : 'light'
136diff --git a/lib/typescript/src/types.d.ts b/lib/typescript/src/types.d.ts
137index 2f1351a89f0f2e67e854dc81e392198326b71834..ccf8556911fa1fa17588f06b56edb2151a712bf0 100644
138--- a/lib/typescript/src/types.d.ts
139+++ b/lib/typescript/src/types.d.ts
140@@ -1091,6 +1091,13 @@ export type NativeStackHeaderItemSpacing = {
141 */
142 export type NativeStackHeaderItemCustom = {
143 type: 'custom';
144+ /**
145+ * An identifier used to match items across transitions.
146+ * Only available from iOS 26.0 and later.
147+ *
148+ * Read more: https://developer.apple.com/documentation/uikit/uibarbuttonitem/identifier
149+ */
150+ identifier?: string;
151 /**
152 * A React Element to display as the item.
153 */
154diff --git a/src/types.tsx b/src/types.tsx
155index 7488b1cf20afe36b5c585fbfcd369471fdb6ab8d..f4bd78e48c687024ba84e998fac79e9eb16f1a80 100644
156--- a/src/types.tsx
157+++ b/src/types.tsx
158@@ -1156,6 +1156,13 @@ export type NativeStackHeaderItemSpacing = {
159 */
160 export type NativeStackHeaderItemCustom = {
161 type: 'custom';
162+ /**
163+ * An identifier used to match items across transitions.
164+ * Only available from iOS 26.0 and later.
165+ *
166+ * Read more: https://developer.apple.com/documentation/uikit/uibarbuttonitem/identifier
167+ */
168+ identifier?: string;
169 /**
170 * A React Element to display as the item.
171 */
172diff --git a/src/views/useHeaderConfigProps.tsx b/src/views/useHeaderConfigProps.tsx
173index 3f3fff405048b3c2250afbe99dd7f35cecb9a6d5..bb062b898cfa77f8c02f951dc9d81b51672d7d0e 100644
174--- a/src/views/useHeaderConfigProps.tsx
175+++ b/src/views/useHeaderConfigProps.tsx
176@@ -397,6 +397,7 @@ export function useHeaderConfigProps({
177 // eslint-disable-next-line @eslint-react/no-array-index-key
178 key={index}
179 hidesSharedBackground={item.hidesSharedBackground}
180+ identifier={item.identifier}
181 >
182 {item.element}
183 </ScreenStackHeaderLeftView>
184@@ -471,6 +472,7 @@ export function useHeaderConfigProps({
185 // eslint-disable-next-line @eslint-react/no-array-index-key
186 key={index}
187 hidesSharedBackground={item.hidesSharedBackground}
188+ identifier={item.identifier}
189 >
190 {item.element}
191 </ScreenStackHeaderRightView>