Skip to content

Commit

Permalink
add suspense boundary
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeKarow committed Sep 18, 2024
1 parent d7ffac2 commit 0e077be
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ import '@mantine/core/styles.css'
import { type Metadata } from 'next'

import { TRPCReactProvider } from '~/trpc/react'
import { ColorSchemeScript } from '@mantine/core'
import { ColorSchemeScript, Loader } from '@mantine/core'
import { MantineProvider } from '~/app/_styles/MantineProvider'
import { I18nProvider } from '~/app/_providers/I18nProvider'
import { initTranslations, namespaces } from '~/app/i18n'
import { Navbar } from '~/app/_components/Navbar'
import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
import { Analytics } from '@vercel/analytics/react'
import { SpeedInsights } from '@vercel/speed-insights/next'
import { Suspense } from 'react'

export const generateStaticParams = async () => ['en', 'es', 'fr'].map((locale) => ({ locale }))
export async function generateMetadata({ params }: RootLayoutProps): Promise<Metadata> {
Expand Down Expand Up @@ -39,7 +40,7 @@ export default async function RootLayout({ children, params: { locale } }: RootL
<I18nProvider namespaces={namespaces} locale={locale} resources={resources}>
<TRPCReactProvider>
<Navbar />
{children}
<Suspense fallback={<Loader />}>{children}</Suspense>
<ReactQueryDevtools buttonPosition='bottom-left' />
</TRPCReactProvider>
</I18nProvider>
Expand Down

0 comments on commit 0e077be

Please sign in to comment.