import React from 'react' ; type State = { error : any ; } ; type Props = { } ; class ErrorBoundary extends React . Component < Props , State > { state = { error : null } ; static getDerivedStateFromError ( error ) { return { error } ; } componentDidCatch ( error , info ) { console . error ( 'Error rendering Papercups chat:' , error , info ) ; } render ( ) { if ( this . state . error ) { return null ; } return this . props . children ; } } export default ErrorBoundary ;