import React , { Component } from 'react' ; import { Header } from '../../typography' ; export class ErrorBoundary extends Component { state = { hasError : false } ; static getDerivedStateFromError ( ) { return { hasError : true } ; } componentDidCatch ( error , errorInfo ) { console . log ( 'ERROR with Iris PopOver component' , error , errorInfo ) ; } render ( ) { if ( this . state . hasError ) { return < Header size = "3" > Something went wrong . < /Header>; } return this . props . children ; } }