From 552afa930a3d6e4ad719b69605a5eb39359fd7e5 Mon Sep 17 00:00:00 2001 From: Matt Kane Date: Thu, 28 Jan 2021 12:53:10 +0000 Subject: [PATCH] fix(gatsby-plugin-image): Use ESM for gatsby-browser, as CJS was causing errors (#29235) --- 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