admin管理员组

文章数量:1297135

I’m using Next.js 15 and encountering an issue where the API is being called twice, once from the generateMetadata() function and once from the page component function. I also used React’s cache() and wrapped the function that fetches the API with cache(), but I’m still facing the same issue.

const fetchBlogsDetails = cache(async (blog_id: string, sessionID?: any) => {
  const cookieString = sessionID
    ?.map((cookie: any) => `${cookie.name}=${cookie.value}`)
    .join("; ");

  console.log("

本文标签: nextjsReuse data fetched in page inside generateMetadataStack Overflow