Ensure useBudget is within BudgetProvider
The useBudget hook was throwing an error when used outside of a BudgetProvider. This commit ensures that the useBudget hook is always used within a BudgetProvider to prevent this error.
This commit is contained in:
49
src/App.tsx
49
src/App.tsx
@@ -19,6 +19,7 @@ import ForgotPassword from './pages/ForgotPassword';
|
||||
import Analytics from './pages/Analytics';
|
||||
import PaymentMethods from './pages/PaymentMethods';
|
||||
import Settings from './pages/Settings';
|
||||
import { BudgetProvider } from './contexts/BudgetContext';
|
||||
|
||||
// 전역 오류 핸들러
|
||||
const handleError = (error: any) => {
|
||||
@@ -74,30 +75,32 @@ function App() {
|
||||
return (
|
||||
<ErrorBoundary>
|
||||
<AuthContextWrapper>
|
||||
<Router>
|
||||
<div className="flex flex-col min-h-screen">
|
||||
<NavBar />
|
||||
<div className="flex-grow">
|
||||
<Routes>
|
||||
<Route path="/" element={<Index />} />
|
||||
<Route path="/login" element={<Login />} />
|
||||
<Route path="/register" element={<Register />} />
|
||||
<Route path="/profile" element={<ProfileManagement />} />
|
||||
<Route path="/settings" element={<Settings />} />
|
||||
<Route path="/supabase-settings" element={<SupabaseSettings />} />
|
||||
<Route path="/transactions" element={<Transactions />} />
|
||||
<Route path="/security-privacy" element={<SecurityPrivacySettings />} />
|
||||
<Route path="/notifications" element={<NotificationSettings />} />
|
||||
<Route path="/help-support" element={<HelpSupport />} />
|
||||
<Route path="/forgot-password" element={<ForgotPassword />} />
|
||||
<Route path="/analytics" element={<Analytics />} />
|
||||
<Route path="/payment-methods" element={<PaymentMethods />} />
|
||||
<Route path="*" element={<NotFound />} />
|
||||
</Routes>
|
||||
<BudgetProvider>
|
||||
<Router>
|
||||
<div className="flex flex-col min-h-screen">
|
||||
<NavBar />
|
||||
<div className="flex-grow">
|
||||
<Routes>
|
||||
<Route path="/" element={<Index />} />
|
||||
<Route path="/login" element={<Login />} />
|
||||
<Route path="/register" element={<Register />} />
|
||||
<Route path="/profile" element={<ProfileManagement />} />
|
||||
<Route path="/settings" element={<Settings />} />
|
||||
<Route path="/supabase-settings" element={<SupabaseSettings />} />
|
||||
<Route path="/transactions" element={<Transactions />} />
|
||||
<Route path="/security-privacy" element={<SecurityPrivacySettings />} />
|
||||
<Route path="/notifications" element={<NotificationSettings />} />
|
||||
<Route path="/help-support" element={<HelpSupport />} />
|
||||
<Route path="/forgot-password" element={<ForgotPassword />} />
|
||||
<Route path="/analytics" element={<Analytics />} />
|
||||
<Route path="/payment-methods" element={<PaymentMethods />} />
|
||||
<Route path="*" element={<NotFound />} />
|
||||
</Routes>
|
||||
</div>
|
||||
<Toaster />
|
||||
</div>
|
||||
<Toaster />
|
||||
</div>
|
||||
</Router>
|
||||
</Router>
|
||||
</BudgetProvider>
|
||||
</AuthContextWrapper>
|
||||
</ErrorBoundary>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user