diff --git a/gatsby-browser.js b/gatsby-browser.js index c0ff776..6bfda6f 100644 --- a/gatsby-browser.js +++ b/gatsby-browser.js @@ -1,6 +1,7 @@ import React from 'react'; import Layout from './src/components/Layout'; +import { onRenderBody } from "./gatsby-ssr"; export function wrapPageElement({ element, props }) { - return {element}; + return {onRenderBody, element}; } \ No newline at end of file diff --git a/gatsby-ssr.js b/gatsby-ssr.js index 1c1ccf7..6853b2c 100644 --- a/gatsby-ssr.js +++ b/gatsby-ssr.js @@ -1,5 +1,6 @@ // gatsby-ssr.js import React from "react"; +import Layout from "./src/components/Layout"; const OusetaScriptComponent = () => { return ( @@ -36,4 +37,8 @@ const onRenderBody = ({ setHeadComponents }) => { return setHeadComponents([OusetaConfigComponent(), OusetaScriptComponent()]); }; -export { onRenderBody }; + +export function wrapPageElement({ element, props }) { + return {onRenderBody, element}; +} +