diff --git a/signup-ui/package-lock.json b/signup-ui/package-lock.json index 12b49bfc..83c526a6 100644 --- a/signup-ui/package-lock.json +++ b/signup-ui/package-lock.json @@ -19,6 +19,7 @@ "@radix-ui/react-select": "^2.0.0", "@radix-ui/react-slot": "^1.0.2", "@tailwindcss/line-clamp": "^0.4.4", + "@tanstack/react-query": "^5.8.4", "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", @@ -57,6 +58,7 @@ }, "devDependencies": { "@ianvs/prettier-plugin-sort-imports": "^4.1.1", + "@tanstack/react-query-devtools": "^5.8.4", "@types/lodash": "^4.14.200", "@types/react-google-recaptcha": "^2.1.7", "autoprefixer": "^10.4.16", @@ -5588,6 +5590,68 @@ "tailwindcss": ">=2.0.0 || >=3.0.0 || >=3.0.0-alpha.1" } }, + "node_modules/@tanstack/query-core": { + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.8.3.tgz", + "integrity": "sha512-SWFMFtcHfttLYif6pevnnMYnBvxKf3C+MHMH7bevyYfpXpTMsLB9O6nNGBdWSoPwnZRXFNyNeVZOw25Wmdasow==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + } + }, + "node_modules/@tanstack/query-devtools": { + "version": "5.8.4", + "resolved": "https://registry.npmjs.org/@tanstack/query-devtools/-/query-devtools-5.8.4.tgz", + "integrity": "sha512-F1dRbITNt9tMUoM9WCH8WQ2c54116hv52m/PKK8ZiN/pO2wGVzTZtKuLanF8pFpwmNchjIixcMw/a57HY5ivcw==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + } + }, + "node_modules/@tanstack/react-query": { + "version": "5.8.4", + "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.8.4.tgz", + "integrity": "sha512-CD+AkXzg8J72JrE6ocmuBEJfGzEzu/bzkD6sFXFDDB5yji9N20JofXZlN6n0+CaPJuIi+e4YLCbGsyPFKkfNQA==", + "dependencies": { + "@tanstack/query-core": "5.8.3" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + }, + "peerDependencies": { + "react": "^18.0.0", + "react-dom": "^18.0.0", + "react-native": "*" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + }, + "react-native": { + "optional": true + } + } + }, + "node_modules/@tanstack/react-query-devtools": { + "version": "5.8.4", + "resolved": "https://registry.npmjs.org/@tanstack/react-query-devtools/-/react-query-devtools-5.8.4.tgz", + "integrity": "sha512-mffs51FJqXU/5rwhbwv393DccL6et7uK2pRLwOcmMrWbPyW8vpxr9oidaghHX4cdVeP/7u5owW9yMpBhBAJfcQ==", + "dev": true, + "dependencies": { + "@tanstack/query-devtools": "5.8.4" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + }, + "peerDependencies": { + "@tanstack/react-query": "^5.8.4", + "react": "^18.0.0", + "react-dom": "^18.0.0" + } + }, "node_modules/@testing-library/dom": { "version": "9.3.3", "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-9.3.3.tgz", @@ -26913,6 +26977,34 @@ "integrity": "sha512-5U6SY5z8N42VtrCrKlsTAA35gy2VSyYtHWCsg1H87NU1SXnEfekTVlrga9fzUDrrHcGi2Lb5KenUWb4lRQT5/g==", "requires": {} }, + "@tanstack/query-core": { + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.8.3.tgz", + "integrity": "sha512-SWFMFtcHfttLYif6pevnnMYnBvxKf3C+MHMH7bevyYfpXpTMsLB9O6nNGBdWSoPwnZRXFNyNeVZOw25Wmdasow==" + }, + "@tanstack/query-devtools": { + "version": "5.8.4", + "resolved": "https://registry.npmjs.org/@tanstack/query-devtools/-/query-devtools-5.8.4.tgz", + "integrity": "sha512-F1dRbITNt9tMUoM9WCH8WQ2c54116hv52m/PKK8ZiN/pO2wGVzTZtKuLanF8pFpwmNchjIixcMw/a57HY5ivcw==", + "dev": true + }, + "@tanstack/react-query": { + "version": "5.8.4", + "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.8.4.tgz", + "integrity": "sha512-CD+AkXzg8J72JrE6ocmuBEJfGzEzu/bzkD6sFXFDDB5yji9N20JofXZlN6n0+CaPJuIi+e4YLCbGsyPFKkfNQA==", + "requires": { + "@tanstack/query-core": "5.8.3" + } + }, + "@tanstack/react-query-devtools": { + "version": "5.8.4", + "resolved": "https://registry.npmjs.org/@tanstack/react-query-devtools/-/react-query-devtools-5.8.4.tgz", + "integrity": "sha512-mffs51FJqXU/5rwhbwv393DccL6et7uK2pRLwOcmMrWbPyW8vpxr9oidaghHX4cdVeP/7u5owW9yMpBhBAJfcQ==", + "dev": true, + "requires": { + "@tanstack/query-devtools": "5.8.4" + } + }, "@testing-library/dom": { "version": "9.3.3", "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-9.3.3.tgz", diff --git a/signup-ui/package.json b/signup-ui/package.json index cd2e395e..83c07f05 100644 --- a/signup-ui/package.json +++ b/signup-ui/package.json @@ -14,6 +14,7 @@ "@radix-ui/react-select": "^2.0.0", "@radix-ui/react-slot": "^1.0.2", "@tailwindcss/line-clamp": "^0.4.4", + "@tanstack/react-query": "^5.8.4", "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", @@ -79,6 +80,7 @@ }, "devDependencies": { "@ianvs/prettier-plugin-sort-imports": "^4.1.1", + "@tanstack/react-query-devtools": "^5.8.4", "@types/lodash": "^4.14.200", "@types/react-google-recaptcha": "^2.1.7", "autoprefixer": "^10.4.16", diff --git a/signup-ui/src/App.tsx b/signup-ui/src/App.tsx index 756544a6..4716f4a2 100644 --- a/signup-ui/src/App.tsx +++ b/signup-ui/src/App.tsx @@ -1,8 +1,9 @@ +import { ReactQueryDevtools } from "@tanstack/react-query-devtools"; import { Inspector, InspectParams } from "react-dev-inspector"; -import { QueryClient, QueryClientProvider } from "react-query"; import "./App.css"; +import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { BrowserRouter } from "react-router-dom"; import Footer from "~components/ui/footer"; @@ -17,9 +18,9 @@ import Footer from "~components/ui/footer"; const queryClient = new QueryClient({ defaultOptions: { queries: { - staleTime: 60 * 1000, // 60 seconds, + staleTime: Infinity, retry: (failureCount, error) => { - // Do not retry on 4xx error codes. + // Do not retry on 4xx error codes if (error instanceof HttpError && String(error.code).startsWith("4")) { return false; } @@ -56,6 +57,10 @@ function App() {