Download apps/web/src/main.tsx from Atmint/cpns: direct link, hf CLI and curl.
- Browser
- Download file 1.02 kB
-
https://huggingface.co/spaces/Atmint/cpns/resolve/main/apps/web/src/main.tsx
- Command line
-
hf download hf://spaces/Atmint/cpns/apps/web/src/main.tsx
-
curl -L -o main.tsx https://huggingface.co/spaces/Atmint/cpns/resolve/main/apps/web/src/main.tsx
1.02 kB
| import { QueryClientProvider } from "@tanstack/react-query"; | |
| import { RouterProvider, createRouter } from "@tanstack/react-router"; | |
| import ReactDOM from "react-dom/client"; | |
| import Loader from "./components/loader"; | |
| import { routeTree } from "./routeTree.gen"; | |
| import { queryClient, trpc } from "./utils/trpc"; | |
| const router = createRouter({ | |
| routeTree, | |
| defaultPreload: "intent", | |
| scrollRestoration: true, | |
| defaultPendingComponent: () => <Loader />, | |
| context: { trpc, queryClient }, | |
| Wrap: function WrapComponent({ children }: { children: React.ReactNode }) { | |
| return <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>; | |
| }, | |
| }); | |
| declare module "@tanstack/react-router" { | |
| interface Register { | |
| router: typeof router; | |
| } | |
| } | |
| const rootElement = document.getElementById("app"); | |
| if (!rootElement) { | |
| throw new Error("Root element not found"); | |
| } | |
| if (!rootElement.innerHTML) { | |
| const root = ReactDOM.createRoot(rootElement); | |
| root.render(<RouterProvider router={router} />); | |
| } | |