From 434b7c8dc8b1df0d6c1838d4599f46de02f4b2c1 Mon Sep 17 00:00:00 2001 From: "Federico Pasqua (eisterman)" Date: Tue, 1 Apr 2025 17:58:11 +0200 Subject: [PATCH] Remove caching. That caching is breaking the program in case of change. Note: "use server" is not good because force the fetch to be action/static so the client doesn't call them again explicitly during render (I think?) --- src/app/(sidebar)/loaders.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/app/(sidebar)/loaders.ts b/src/app/(sidebar)/loaders.ts index f99c6a1..f830945 100644 --- a/src/app/(sidebar)/loaders.ts +++ b/src/app/(sidebar)/loaders.ts @@ -1,10 +1,9 @@ import { getContact, getContacts } from "@/app/data"; -import { cache } from "react"; -export const fetchContacts = cache(async () => { +export const fetchContacts = async () => { return await getContacts(); -}); +}; -export const fetchContact = cache(async (contactId: string) => { +export const fetchContact = async (contactId: string) => { return await getContact(contactId); -}); +};