Skip to content

Commit 2d7e861

Browse files
authored
fix: Prevent initial page to load twice (#453)
1 parent 49ede0f commit 2d7e861

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

src/app/admin/layout.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { ReactNode, Suspense } from 'react';
1+
import { ReactNode } from 'react';
22

33
import { NextLoader } from '@/app/NextLoader';
44

55
export default function AdminLayout({ children }: { children: ReactNode }) {
66
return (
7-
<Suspense>
7+
<>
88
<NextLoader lightColor="white" darkColor="white" />
99
{children}
10-
</Suspense>
10+
</>
1111
);
1212
}

src/app/app/layout.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { ReactNode, Suspense } from 'react';
1+
import { ReactNode } from 'react';
22

33
import { NextLoader } from '@/app/NextLoader';
44

55
export default function AppLayout({ children }: { children: ReactNode }) {
66
return (
7-
<Suspense>
7+
<>
88
<NextLoader showSpinner />
99
{children}
10-
</Suspense>
10+
</>
1111
);
1212
}

src/app/layout.tsx

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ReactNode, Suspense } from 'react';
1+
import { ReactNode } from 'react';
22

33
import { Metadata } from 'next';
44

@@ -18,10 +18,8 @@ export default async function RootLayout({
1818
}) {
1919
return (
2020
<Document>
21-
<Suspense>
22-
<NextLoader />
23-
{children}
24-
</Suspense>
21+
<NextLoader />
22+
{children}
2523
</Document>
2624
);
2725
}

0 commit comments

Comments
 (0)