import { ComponentType } from "react" ; import { v1 as uuid } from "uuid" ; import { ErrorReport , ErrorReporter , User } from "./reporter" ; class FakeErrorReporter implements ErrorReporter { public report ( err ) { if ( process . env . NODE_ENV !== "production" ) { console . error ( err ) ; } return { name : "global" , id : uuid ( ) , } ; } public setUser ( user ) { } public get ErrorBoundary ( ) : ComponentType | undefined { return undefined ; } } export let globalErrorReporter = new FakeErrorReporter ( ) ; export function setGlobalErrorReporter ( reporter ) { globalErrorReporter = reporter ; }