Skip to content

Commit

Permalink
Merge pull request #22 from cnpem/fix-react-query-devtools
Browse files Browse the repository at this point in the history
fix(spu-ui): react-query devtools
  • Loading branch information
brnovasco authored Nov 25, 2024
2 parents 91fa706 + 6b02de0 commit cf11c70
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions apps/spu-ui/src/trpc/react.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
"use client";

import type { QueryClient } from "@tanstack/react-query";
import { lazy, useState } from "react";
import { useState } from "react";
import { QueryClientProvider } from "@tanstack/react-query";
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
import { loggerLink, unstable_httpBatchStreamLink } from "@trpc/client";
import { createTRPCReact } from "@trpc/react-query";
import superJSON from "superjson";
import type { AppRouter } from "@sophys-web/api";
import { env } from "../env";
import { createQueryClient } from "./query-client";

const ReactQueryDevtools =
env.NODE_ENV === "production"
? () => null
: lazy(() =>
import("@tanstack/react-query-devtools").then((mod) => ({
default: mod.ReactQueryDevtools,
})),
);

let clientQueryClientSingleton: QueryClient | undefined;
const getQueryClient = () => {
if (typeof window === "undefined") {
Expand Down

0 comments on commit cf11c70

Please sign in to comment.