Reputation: 7406
Suppose I have a middleware that adds some data fields to express.js req
object. I want to inject these fields into my React components through my Next.js _app.js
implementation. How do I access req
inside _app.js
?
Upvotes: 3
Views: 1591
Reputation: 4810
try this static async getInitialProps({ Component, ctx }) {
and inside the function ctx.req
Upvotes: 3