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
版权声明:本文标题:next.js - Reuse data fetched in page inside generateMetadata - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人,
转载请联系作者并注明出处:http://www.betaflare.com/web/1741641008a2389916.html,
本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论