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 { 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>
</> </>
) )
} }