Skip to content

Commit

Permalink
feat: 完善 getRender中 renderToString 的 injectContext
Browse files Browse the repository at this point in the history
  • Loading branch information
imsunhao committed Mar 19, 2019
1 parent 43918fd commit d3435e6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/utils/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ export function getRender(

const nonce = randomStringAsBase64Url(12)

const injectContext = {
...opts.context,
...req.injectContext,
}

const context = {
...opts.context,
pageInfo: {
Expand All @@ -130,7 +135,7 @@ export function getRender(
headers: req.headers,
url: req.url,
cookies: req.cookies,
injectContext: req.injectContext || {},
injectContext,
head: getContextHead(req, opts.context, nonce)
}

Expand Down

0 comments on commit d3435e6

Please sign in to comment.