Skip to content

Commit

Permalink
feat: added react-query v5
Browse files Browse the repository at this point in the history
  • Loading branch information
BubbleDK committed Aug 29, 2024
1 parent e71bc19 commit 7302e5d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
1 change: 1 addition & 0 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"@mantine/tiptap": "^6.0.21",
"@mantine/utils": "^6.0.21",
"@tabler/icons-react": "^3.12.0",
"@tanstack/react-query": "^5.52.2",
"@tiptap/core": "^2.1.11",
"@tiptap/extension-color": "^2.1.11",
"@tiptap/extension-highlight": "^2.1.11",
Expand Down
16 changes: 16 additions & 0 deletions web/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 14 additions & 1 deletion web/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import App from "./App";
import { isEnvBrowser } from "./utils/misc";
import { HashRouter } from "react-router-dom";
import "./index.css";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";

if (isEnvBrowser()) {
const root = document.getElementById("root");
Expand All @@ -15,13 +16,25 @@ if (isEnvBrowser()) {
root!.style.backgroundPosition = "center";
}

export const queryClient = new QueryClient({
defaultOptions: {
queries: {
refetchOnWindowFocus: false,
refetchOnReconnect: false,
refetchOnMount: false,
},
},
});

ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
<React.StrictMode>
<MantineProvider
theme={{ colorScheme: "dark", fontFamily: "Nunito, sans-serif" }}
>
<HashRouter>
<App />
<QueryClientProvider client={queryClient}>
<App />
</QueryClientProvider>
</HashRouter>
</MantineProvider>
</React.StrictMode>
Expand Down

0 comments on commit 7302e5d

Please sign in to comment.