forked from Lex-Studios/Stellar-Spend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAppProviders.tsx
More file actions
33 lines (30 loc) · 978 Bytes
/
Copy pathAppProviders.tsx
File metadata and controls
33 lines (30 loc) · 978 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
'use client';
import { ReactNode } from 'react';
import { ToastProvider } from './ToastContext';
import { ThemeProvider } from './ThemeContext';
import { I18nProvider } from '@/lib/i18n/provider';
import { ErrorBoundary } from '@/components/ErrorBoundary';
interface AppProvidersProps {
children: ReactNode;
}
/**
* Composite provider wrapper for all app-level context providers.
* Provider ordering is critical:
* 1. I18nProvider - must be outermost (affects all descendants)
* 2. ErrorBoundary - catches errors across all descendants
* 3. ThemeProvider - sets up theme context
* 4. ToastProvider - notification system
*
* Changing this order can cause hydration mismatches or context errors.
*/
export function AppProviders({ children }: AppProvidersProps) {
return (
<I18nProvider>
<ErrorBoundary>
<ThemeProvider>
<ToastProvider>{children}</ToastProvider>
</ThemeProvider>
</ErrorBoundary>
</I18nProvider>
);
}