You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As the title asks, when I use app router, I need to add use client to the page if I want to use a subcomponent like Layout.Footer, but then how do I get the data on the server side and complete the ssr?
Just await fetch will result in an infinite client request on older versions of Next.js and an error on newer versions of Next.js: vercel/next.js#42180
The text was updated successfully, but these errors were encountered:
正如标题所问,当我使用 app router 时,我如果要使用类似
Layout.Footer
的子组件,就需要在页面添加use client
,但是这时我该如何在服务端获取数据并完成 ssr ?直接
await fetch
的话,在老版本 Next.js 上会造成客户端也产生请求并无限重发,在新版本 Next.js 上会报错:vercel/next.js#42180As the title asks, when I use app router, I need to add
use client
to the page if I want to use a subcomponent likeLayout.Footer
, but then how do I get the data on the server side and complete the ssr?Just
await fetch
will result in an infinite client request on older versions of Next.js and an error on newer versions of Next.js: vercel/next.js#42180The text was updated successfully, but these errors were encountered: