chore: Add ErrorBoundary
This commit is contained in:
parent
363f3a1d01
commit
acb7310fc7
@ -2,15 +2,19 @@
|
|||||||
|
|
||||||
import { useCurrentLocale } from '@/locales/client'
|
import { useCurrentLocale } from '@/locales/client'
|
||||||
import { LocaleProvider } from './LocaleProvider'
|
import { LocaleProvider } from './LocaleProvider'
|
||||||
|
import ServerError from './error'
|
||||||
|
import { ErrorBoundary } from 'next/dist/client/components/error-boundary'
|
||||||
|
|
||||||
export default function LocaleLayout({ children }) {
|
export default function LocaleLayout({ children }) {
|
||||||
const locale = useCurrentLocale()
|
const locale = useCurrentLocale()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<LocaleProvider locale={locale} fallback={''}>
|
<ErrorBoundary fallback={<ServerError />}>
|
||||||
{children}
|
<LocaleProvider locale={locale} fallback={<ServerError />}>
|
||||||
</LocaleProvider>
|
{children}
|
||||||
|
</LocaleProvider>
|
||||||
|
</ErrorBoundary>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user