Closed ms-sch closed 2 years ago
Add some console.log at function News() -> https://github.com/vercel/next-rsc-demo/blob/main/pages/rsc.server.js#L39 Run next with next dev Go to http://localhost:3000/rsc Check console output
console.log
function News()
next dev
So the problem is that each Page/Component is wrapped by RSCComponent -> https://github.com/vercel/next.js/blob/v12.0.5-canary.4/packages/next/client/index.tsx#L716 this component use another component RSCWrapper, which hit server second time
RSCComponent
RSCWrapper
This is currently expected but we will improve this with https://github.com/vercel/next.js/issues/30994, thanks for the feedback!
How to reproduce
Add some
console.log
atfunction News()
-> https://github.com/vercel/next-rsc-demo/blob/main/pages/rsc.server.js#L39 Run next withnext dev
Go to http://localhost:3000/rsc Check console outputSo the problem is that each Page/Component is wrapped by
RSCComponent
-> https://github.com/vercel/next.js/blob/v12.0.5-canary.4/packages/next/client/index.tsx#L716 this component use another componentRSCWrapper
, which hit server second time