From 6fba9d1b836cf81e20d0a8b29c60d6ba8b8551e1 Mon Sep 17 00:00:00 2001
From: MohamedBassem <me@mbassem.com>
Date: Mon, 16 Dec 2024 12:26:09 +0000
Subject: fix(mobile): useLayoutEffect for navigator changes

---
 apps/mobile/app/dashboard/archive.tsx | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

(limited to 'apps/mobile/app/dashboard/archive.tsx')

diff --git a/apps/mobile/app/dashboard/archive.tsx b/apps/mobile/app/dashboard/archive.tsx
index b4cc3a66..b02088c8 100644
--- a/apps/mobile/app/dashboard/archive.tsx
+++ b/apps/mobile/app/dashboard/archive.tsx
@@ -1,13 +1,16 @@
+import { useLayoutEffect } from "react";
 import { useNavigation } from "expo-router";
 import UpdatingBookmarkList from "@/components/bookmarks/UpdatingBookmarkList";
 import CustomSafeAreaView from "@/components/ui/CustomSafeAreaView";
 
 export default function Archive() {
   const navigator = useNavigation();
-  navigator.setOptions({
-    headerTitle: "🗄️ Archive",
-    headerLargeTitle: true,
-  });
+  useLayoutEffect(() => {
+    navigator.setOptions({
+      headerTitle: "🗄️ Archive",
+      headerLargeTitle: true,
+    });
+  }, [navigator]);
   return (
     <CustomSafeAreaView>
       <UpdatingBookmarkList query={{ archived: true }} />
-- 
cgit v1.3-1-g0d28

