Files
30-seconds-of-code/node_modules/gatsby-plugin-react-helmet/gatsby-ssr.js
2019-08-20 15:52:05 +02:00

27 lines
891 B
JavaScript

"use strict";
exports.__esModule = true;
exports.onRenderBody = void 0;
var _reactHelmet = require("react-helmet");
var onRenderBody = function onRenderBody(_ref) {
var setHeadComponents = _ref.setHeadComponents,
setHtmlAttributes = _ref.setHtmlAttributes,
setBodyAttributes = _ref.setBodyAttributes;
var helmet = _reactHelmet.Helmet.renderStatic(); // These action functions were added partway through the Gatsby 1.x cycle.
if (setHtmlAttributes) {
setHtmlAttributes(helmet.htmlAttributes.toComponent());
}
if (setBodyAttributes) {
setBodyAttributes(helmet.bodyAttributes.toComponent());
}
setHeadComponents([helmet.title.toComponent(), helmet.link.toComponent(), helmet.meta.toComponent(), helmet.noscript.toComponent(), helmet.script.toComponent(), helmet.style.toComponent(), helmet.base.toComponent()]);
};
exports.onRenderBody = onRenderBody;