From 36d4083bde5940e75cd036e1b03c53cbf18dbfe9 Mon Sep 17 00:00:00 2001 From: Ammari Abdelmounaim <102379343+AmmariAbdelmounaim@users.noreply.github.com> Date: Tue, 16 Jan 2024 00:29:59 +0100 Subject: [PATCH] Refactor: Replace useContext with useUtils `useUtils` is a hook that replaces `useContext`, providing cache management via `@trpc/react-query` and serving as a wrapper for `@tanstack/react-query` methods, with additional detailed documentation available. --- src/components/Dashboard.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Dashboard.tsx b/src/components/Dashboard.tsx index d7111502..25aa5408 100644 --- a/src/components/Dashboard.tsx +++ b/src/components/Dashboard.tsx @@ -24,7 +24,7 @@ const Dashboard = ({subscriptionPlan}: PageProps) => { const [currentlyDeletingFile, setCurrentlyDeletingFile] = useState(null) - const utils = trpc.useContext() + const utils = trpc.useUtils() const { data: files, isLoading } = trpc.getUserFiles.useQuery()