#Next.js Fetching issue

3 messages · Page 1 of 1 (latest)

random dove
#

Hello,

I have a problem with my code when I am fetching data with useEffect (https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations#useeffect) my Computed Time on vercel DB is okay but when I change my fetch to server components (https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations#server-components) my Computed Time goes up like crazy... Like 0.05h in every 10 minutes... This is just crazy.... I changed my app to use server components like 4-5 days ago and it cost like 6h per day Computed Time.... With useEffect it was like 1.5h per day...

Learn how to handle form submissions and data mutations with Next.js.

nova rockBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

random dove
#

But I want to fetch data with server because I do not have loading states for users and it looks better... Can someone please help me what is wrong?

useEffect: https://pastebin.com/bkp6FAyp
Server component: https://pastebin.com/sAjhEXwf