#The first `fetch` is getting executed twice

8 messages · Page 1 of 1 (latest)

gilded spoke
#

I have a page.tsx with a fetch call in CSR. This call is being made twice.

"use client";

import { Transaction } from "@/components/transactions";
import { getTransaction } from "@/utils/services/api";

const Page = async () => {
    const data = await getTransaction();

    return <div>{JSON.stringify(data)}</div>;
};

export default Page;
calm void
#

Client components cannot be async

gilded spoke
kind light
#

unless getTransaction has react hook in that case yeah just traditional useEffect api call

gilded spoke
#

My PM wants a CSR 😅

#

Thank you!

calm void