Skip to content

Commit

Permalink
chore: Remove prefetch function in main.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
7nohe committed May 3, 2024
1 parent e39bcbf commit 4c74add
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
2 changes: 1 addition & 1 deletion examples/nextjs-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"build": "next build",
"start": "next start",
"lint": "next lint",
"generate:api": "rimraf ./openapi && node ../../dist/cli.mjs -i ./petstore.yaml -c axios --request ./request.ts"
"generate:api": "rimraf ./openapi && node ../../dist/cli.mjs -i ./petstore.yaml -c axios --request ./request.ts --format=biome --lint=biome"
},
"dependencies": {
"@tanstack/react-query": "^5.18.1",
Expand Down
21 changes: 7 additions & 14 deletions examples/react-app/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,12 @@ import ReactDOM from "react-dom/client";
import App from "./App";
import "./index.css";
import { QueryClientProvider } from "@tanstack/react-query";
import { prefetchUseDefaultServiceFindPets } from "../openapi/queries/prefetch";
import { queryClient } from "./queryClient";

async function PrefetchData() {
await prefetchUseDefaultServiceFindPets(queryClient);
}

PrefetchData().then(() => {
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
<React.StrictMode>
<QueryClientProvider client={queryClient}>
<App />
</QueryClientProvider>
</React.StrictMode>,
);
});
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
<React.StrictMode>
<QueryClientProvider client={queryClient}>
<App />
</QueryClientProvider>
</React.StrictMode>,
);

0 comments on commit 4c74add

Please sign in to comment.