chore: Add ErrorBoundary

This commit is contained in:
yoosangwook 2024-08-22 14:19:39 +09:00
parent 363f3a1d01
commit acb7310fc7

View File

@ -2,15 +2,19 @@
import { useCurrentLocale } from '@/locales/client'
import { LocaleProvider } from './LocaleProvider'
import ServerError from './error'
import { ErrorBoundary } from 'next/dist/client/components/error-boundary'
export default function LocaleLayout({ children }) {
const locale = useCurrentLocale()
return (
<>
<LocaleProvider locale={locale} fallback={''}>
{children}
</LocaleProvider>
<ErrorBoundary fallback={<ServerError />}>
<LocaleProvider locale={locale} fallback={<ServerError />}>
{children}
</LocaleProvider>
</ErrorBoundary>
</>
)
}