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/favourites.tsx | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

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

diff --git a/apps/mobile/app/dashboard/favourites.tsx b/apps/mobile/app/dashboard/favourites.tsx
index 1dddfe31..3dd2aa09 100644
--- a/apps/mobile/app/dashboard/favourites.tsx
+++ b/apps/mobile/app/dashboard/favourites.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 Favourites() {
   const navigator = useNavigation();
-  navigator.setOptions({
-    headerTitle: "⭐️ Favourites",
-    headerLargeTitle: true,
-  });
+  useLayoutEffect(() => {
+    navigator.setOptions({
+      headerTitle: "⭐️ Favourites",
+      headerLargeTitle: true,
+    });
+  }, [navigator]);
   return (
     <CustomSafeAreaView>
       <UpdatingBookmarkList
-- 
cgit v1.3-1-g0d28

