From 2693feef6a762bce1523bd7dd1c71b6162657c5d Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Tue, 2 Jun 2020 11:15:40 -0700 Subject: [PATCH] feat: load deps needed for sdk in ssr --- gatsby-ssr.js | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/gatsby-ssr.js b/gatsby-ssr.js index b17b8fc19..41ae50b21 100644 --- a/gatsby-ssr.js +++ b/gatsby-ssr.js @@ -4,4 +4,36 @@ * See: https://www.gatsbyjs.org/docs/ssr-apis/ */ -// You can delete this file if you're not using it +// This is needed to ensure the NR1 SDK can load properly +const React = require('react'); + +exports.onPreRenderHTML = ({ getHeadComponents, replaceHeadComponents }) => { + replaceHeadComponents([ + ...getHeadComponents(), +