From 29b7c5c8d10d5315fea27fc25f1f153c6c12dfbf Mon Sep 17 00:00:00 2001 From: MohamedBassem Date: Sat, 2 Mar 2024 20:45:11 +0000 Subject: fix: Fix hydration in list view caused by the spinner --- packages/web/app/dashboard/lists/components/AllListsView.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'packages/web/app/dashboard/lists/components') diff --git a/packages/web/app/dashboard/lists/components/AllListsView.tsx b/packages/web/app/dashboard/lists/components/AllListsView.tsx index 155cdbcf..d81f5fca 100644 --- a/packages/web/app/dashboard/lists/components/AllListsView.tsx +++ b/packages/web/app/dashboard/lists/components/AllListsView.tsx @@ -1,7 +1,6 @@ "use client"; import { Button } from "@/components/ui/button"; -import LoadingSpinner from "@/components/ui/spinner"; import { api } from "@/lib/trpc"; import { ZBookmarkList } from "@/lib/types/api/lists"; import { keepPreviousData } from "@tanstack/react-query"; @@ -35,14 +34,13 @@ export default function AllListsView({ initialData: ZBookmarkList[]; }) { const { setOpen: setIsNewListModalOpen } = useNewListModal(); - const { data: lists } = api.lists.list.useQuery(undefined, { + let { data: lists } = api.lists.list.useQuery(undefined, { initialData: { lists: initialData }, placeholderData: keepPreviousData, }); - if (!lists) { - return ; - } + // TODO: This seems to be a bug in react query + lists ||= { lists: initialData }; return (
-- cgit v1.2.3-70-g09d2