Skip to content

Commit a8edb9a

Browse files
author
Deepak Pandey
committed
Remove loading states from server-side rendered auth components
- Set loading: () => null for all dynamic auth components - This prevents 'Loading...' text from appearing in server-rendered HTML - Auth components will only render on client-side after hydration This should eliminate the persistent loading text in the header.
1 parent 6f7b3e9 commit a8edb9a

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

components/header.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const AuthSection = dynamic(() => Promise.resolve(() => {
4242
)
4343
}), {
4444
ssr: false,
45-
loading: () => <div className="text-sm text-muted-foreground">Loading...</div>
45+
loading: () => null // Don't show loading state on server
4646
})
4747

4848
// Mobile auth section
@@ -64,7 +64,8 @@ const MobileAuthSection = dynamic(() => Promise.resolve(() => {
6464

6565
return null
6666
}), {
67-
ssr: false
67+
ssr: false,
68+
loading: () => null
6869
})
6970

7071
// Mobile menu auth section
@@ -102,7 +103,8 @@ const MobileMenuAuthSection = dynamic(() => Promise.resolve(() => {
102103
</div>
103104
)
104105
}), {
105-
ssr: false
106+
ssr: false,
107+
loading: () => null
106108
})
107109

108110
// Lazy load non-critical components

0 commit comments

Comments
 (0)