Something went wrong. Try again.
an independent Bluesky client using Constellation, PDS Queries, and other services forked from whey.party/red-dwarf
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768import { StrictMode } from "react";import ReactDOM from "react-dom/client";import { RouterProvider, createRouter } from "@tanstack/react-router";
// Import the generated route treeimport { routeTree } from "./routeTree.gen";
import "~/styles/app.css";import reportWebVitals from "./reportWebVitals.ts";import { QueryClient, QueryClientProvider, } from "@tanstack/react-query";import { persistQueryClient,} from "@tanstack/react-query-persist-client";import { createSyncStoragePersister } from "@tanstack/query-sync-storage-persister";
const queryClient = new QueryClient({ defaultOptions: { queries: { gcTime: 1000 * 60 * 60 * 24 * 24, // 24 days }, },});const localStoragePersister = createSyncStoragePersister({ storage: window.localStorage,});
persistQueryClient({ queryClient, persister: localStoragePersister,})
// Create a new router instanceconst router = createRouter({ routeTree, context: { queryClient }, defaultPreload: "intent", scrollRestoration: true, defaultStructuralSharing: true, defaultPreloadStaleTime: 0,});
// Register the router instance for type safetydeclare module "@tanstack/react-router" { interface Register { router: typeof router; }}
// Render the appconst rootElement = document.getElementById("app");if (rootElement && !rootElement.innerHTML) { const root = ReactDOM.createRoot(rootElement); root.render( // double queries annoys me // <StrictMode> <QueryClientProvider client={queryClient}> <RouterProvider router={router} /> </QueryClientProvider> // </StrictMode> );}
// If you want to start measuring performance in your app, pass a function// to log results (for example: reportWebVitals(// /*mass comment*/ console.log))// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitalsreportWebVitals();