import React from "react" ; import { render } from "react-dom" ; import ErrorOverlay from "./ErrorOverlay" ; const createErrorOverlay = ( { query , networkError } ) => { if ( document . getElementById ( "overlay-root" ) ) { return ; } const container = document . createElement ( "div" ) ; container . id = "overlay-root" ; const body = document . getElementsByTagName ( "body" ) [ 0 ] ; body . appendChild ( container ) ; render ( < ErrorOverlay query = { query } networkError = { networkError } / > , container ) ; } ; export default createErrorOverlay ;