refactor(nav): lift navigation + history into NavigationProvider
Move page/channelView/ytSearch and the history/popstate/title effects out of the App god component into a new NavigationProvider (split state/actions contexts so the memo'd VideoCard doesn't re-render on a page/channel switch). App consumes it via useNavigation/useNavigationActions but still passes the props down for now; the consumer migration that removes the prop-drilling follows.
This commit is contained in:
@@ -3,6 +3,7 @@ import { createRoot } from "react-dom/client";
|
||||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
||||
import ErrorBoundary from "./components/ErrorBoundary";
|
||||
import { ConfirmProvider } from "./components/ConfirmProvider";
|
||||
import { NavigationProvider } from "./components/NavigationProvider";
|
||||
import "./i18n";
|
||||
import "./index.css";
|
||||
|
||||
@@ -35,7 +36,9 @@ const root =
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<ErrorBoundary>
|
||||
<ConfirmProvider>
|
||||
<App />
|
||||
<NavigationProvider>
|
||||
<App />
|
||||
</NavigationProvider>
|
||||
</ConfirmProvider>
|
||||
</ErrorBoundary>
|
||||
</QueryClientProvider>
|
||||
|
||||
Reference in New Issue
Block a user