Cybersecurity-Projects/PROJECTS/encrypted-p2p-chat/frontend/src/index.tsx

33 lines
646 B
TypeScript

import { render } from "solid-js/web";
import { Router } from "@solidjs/router";
import { QueryClient, QueryClientProvider } from "@tanstack/solid-query";
import App from "./App";
import "./index.css";
const queryClient = new QueryClient({
defaultOptions: {
queries: {
refetchOnWindowFocus: false,
retry: 1,
staleTime: 5 * 60 * 1000,
},
},
});
const root = document.getElementById("root");
if (root === null) {
throw new Error("Root element not found");
}
render(
() => (
<QueryClientProvider client={queryClient}>
<Router>
<App />
</Router>
</QueryClientProvider>
),
root
);