From db322e55e73990ac10935b8166e5ceced763f028 Mon Sep 17 00:00:00 2001 From: Matt Kane Date: Wed, 27 Jan 2021 17:29:08 +0000 Subject: [PATCH] fix(gatsby-plugin-image): Use ESM for gatsby-browser, as CJS was causing errors --- packages/gatsby-plugin-image/gatsby-browser.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/packages/gatsby-plugin-image/gatsby-browser.js b/packages/gatsby-plugin-image/gatsby-browser.js index 128583a12d676..2e00cd32ff4f0 100644 --- a/packages/gatsby-plugin-image/gatsby-browser.js +++ b/packages/gatsby-plugin-image/gatsby-browser.js @@ -1,11 +1,6 @@ -const React = require("react") +import React from "react" +import { LaterHydrator } from "." -const { LaterHydrator } = require(".") - -exports.wrapRootElement = ({ element }) => { - return ( - - {element} - - ) +export function wrapRootElement({ element }) { + return {element} } \ No newline at end of file