chore(native): define the root error fallback outside RootLayout

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
jakeandClaude Sonnet 5.5 committed 2026-10-05 14:06:01 -04:00
1 parent 51d193b411
commit e7f55d30e9
1 file changed
+5 -1
+5 -1
View File
@@ -207,6 +207,10 @@ function QueryProvider({ children }: { children: React.ReactNode }) {
return <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>;
}
const renderRootErrorFallback = ({ resetError }: { resetError: () => void }) => (
<RootErrorFallback resetError={resetError} />
);
function RootLayout() {
const inner = (
<I18nProvider i18n={i18n}>
@@ -224,7 +228,7 @@ function RootLayout() {
const guarded = (
<Sentry.ErrorBoundary
fallback={({ resetError }) => <RootErrorFallback resetError={resetError} />}
fallback={renderRootErrorFallback}
onError={(error) => {
posthog?.captureException(error, { source: "error-boundary" });
}}