99 * @param {function } $0.setHeadComponents Takes an array of components as its
1010 * first argument which are added to the `headComponents` array which is passed
1111 * to the `html.js` component.
12+ * @param {function } $0.setHtmlAttributes Takes an object of props which will
13+ * spread into the `<html>` component.
14+ * @param {function } $0.setBodyAttributes Takes an object of props which will
15+ * spread into the `<body>` component.
1216 * @param {function } $0.setPreBodyComponents Takes an array of components as its
1317 * first argument which are added to the `preBodyComponents` array which is passed
1418 * to the `html.js` component.
@@ -55,6 +59,10 @@ exports.replaceRenderer = true
5559 * @param {function } $0.setHeadComponents Takes an array of components as its
5660 * first argument which are added to the `headComponents` array which is passed
5761 * to the `html.js` component.
62+ * @param {function } $0.setHtmlAttributes Takes an object of props which will
63+ * spread into the `<html>` component.
64+ * @param {function } $0.setBodyAttributes Takes an object of props which will
65+ * spread into the `<body>` component.
5866 * @param {function } $0.setPreBodyComponents Takes an array of components as its
5967 * first argument which are added to the `preBodyComponents` array which is passed
6068 * to the `html.js` component.
@@ -67,11 +75,20 @@ exports.replaceRenderer = true
6775 * @example
6876 * import helmet from "react-helmet"
6977 *
70- * exports.onRenderBody = ({ setHeadComponents }, pluginOptions) => {
78+ * exports.onRenderBody = (
79+ * { setHeadComponents, setHtmlAttributes, setBodyAttributes },
80+ * pluginOptions
81+ * ) => {
82+ * const helmet = Helmet.renderStatic()
83+ * setHtmlAttributes(helmet.htmlAttributes.toComponent())
84+ * setBodyAttributes(helmet.bodyAttributes.toComponent())
7185 * setHeadComponents([
7286 * helmet.title.toComponent(),
73- * helmet.meta.toComponent(),
7487 * helmet.link.toComponent(),
88+ * helmet.meta.toComponent(),
89+ * helmet.noscript.toComponent(),
90+ * helmet.script.toComponent(),
91+ * helmet.style.toComponent(),
7592 * ])
7693 * }
7794 */
0 commit comments