Skip to content

Commit

Permalink
fix: Add gatsby's react to the window instead of importing from nr-as…
Browse files Browse the repository at this point in the history
…sets
  • Loading branch information
LizBaker committed Mar 25, 2021
1 parent 317bf05 commit 253e7a7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion gatsby-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,11 @@ const onRouteUpdate = ({ location }) => {

return null;
};
export { onRouteUpdate, wrapPageElement, onInitialClientRender };

const onClientEntry = () => {
// Expose both globals so that the NR1 docs can read it.
window.React = require('react');
window.ReactDOM = require('react-dom');
};

export { onRouteUpdate, wrapPageElement, onInitialClientRender, onClientEntry };

0 comments on commit 253e7a7

Please sign in to comment.