Next.js Discord

Discord Forum

NextJS 13 with KeystoneCMS (Need access to req/res pair in Server Component)

Unanswered
Borzoi posted this in #help-forum
Open in Discord
BorzoiOP
Hello

https://github.com/keystonejs/keystone/blob/main/examples/framework-nextjs-pages-directory/src/pages/index.tsx#L70

This shows how to use KeystoneCMS with NextJS 12. You need to pass the req and res to get the Keystone context in the getServerSideProps.

How do I do that with NextJS 13? How do I get access to the req and res in a Server Component?

For example, here: https://github.com/vercel/app-playground/blob/main/app/ssr/%5Bid%5D/page.tsx#L4

0 Replies