Skip to content

Commit fc85e35

Browse files
committed
fix(mobile): stabilize split header transitions
1 parent 574c5d8 commit fc85e35

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

‎apps/mobile/src/features/home/HomeRouteScreen.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ export function HomeRouteScreen() {
8686
if (layout.usesSplitView) {
8787
return (
8888
<>
89-
<NativeStackScreenOptions options={{ title: "", headerTitle: "" }} />
89+
<NativeStackScreenOptions
90+
options={{ title: "", headerTitle: "", unstable_headerLeftItems: () => [] }}
91+
/>
9092
<WorkspaceSidebarToolbar
9193
afterSidebarButton={
9294
<NativeHeaderToolbar.Button

‎apps/mobile/src/native/StackHeader.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,8 @@ function NativeHeaderToolbarRoot(props: {
364364
const navigation = useNativeStackNavigation();
365365
const items = useMemo(() => collectToolbarItems(props.children), [props.children]);
366366

367-
useEffect(() => {
367+
// Swap toolbar owners before paint so split and compact headers cannot clear each other.
368+
useLayoutEffect(() => {
368369
if (!navigation) {
369370
return;
370371
}

0 commit comments

Comments
 (0)