From 5dd7c9fbe6841f718ed1563cbf2f4b60bc99e9d7 Mon Sep 17 00:00:00 2001 From: Clark Du Date: Fri, 3 Nov 2017 11:14:49 +0800 Subject: [PATCH] add doc for inBody --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 78cdcb0..77a37f2 100644 --- a/README.md +++ b/README.md @@ -193,6 +193,7 @@ app.get('*', (req, res) => { const context = { url: req.url } renderer.renderToString(context, (error, html) => { if (error) return res.send(error.stack) + const bodyOpt = { inBody: true } const { title, htmlAttrs, bodyAttrs, link, style, script, noscript, meta } = context.meta.inject() @@ -211,6 +212,7 @@ app.get('*', (req, res) => { ${html} + ${script.text(bodyOpt)} `) @@ -228,6 +230,7 @@ app.get('*', (req, res) => { const context = { url: req.url } const renderStream = renderer.renderToStream(context) renderStream.once('data', () => { + const bodyOpt = { inBody: true } const { title, htmlAttrs, bodyAttrs, link, style, script, noscript, meta } = context.meta.inject() @@ -252,6 +255,7 @@ app.get('*', (req, res) => { res.end(` + ${script.text(bodyOpt)} `) @@ -497,6 +501,18 @@ Each item in the array maps to a newly-created ` ``` +If your browser doesn't support `defer` or any other reason, you want to put `