mirror of
https://github.com/jakejarvis/sofa.git
synced 2026-10-15 23:55:43 -04:00
chore(native): define the root error fallback outside RootLayout
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 file changed
+5
-1
@@ -207,6 +207,10 @@ function QueryProvider({ children }: { children: React.ReactNode }) {
|
|||||||
return <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>;
|
return <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const renderRootErrorFallback = ({ resetError }: { resetError: () => void }) => (
|
||||||
|
<RootErrorFallback resetError={resetError} />
|
||||||
|
);
|
||||||
|
|
||||||
function RootLayout() {
|
function RootLayout() {
|
||||||
const inner = (
|
const inner = (
|
||||||
<I18nProvider i18n={i18n}>
|
<I18nProvider i18n={i18n}>
|
||||||
@@ -224,7 +228,7 @@ function RootLayout() {
|
|||||||
|
|
||||||
const guarded = (
|
const guarded = (
|
||||||
<Sentry.ErrorBoundary
|
<Sentry.ErrorBoundary
|
||||||
fallback={({ resetError }) => <RootErrorFallback resetError={resetError} />}
|
fallback={renderRootErrorFallback}
|
||||||
onError={(error) => {
|
onError={(error) => {
|
||||||
posthog?.captureException(error, { source: "error-boundary" });
|
posthog?.captureException(error, { source: "error-boundary" });
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in new issue
Block a user