import React from 'react' ; interface Props { onCatch ( error , errorInfo ) : void ; } export default class Crashable extends React . PureComponent < Props > { componentDidCatch ( error , errorInfo ) { this . props . onCatch ( error , errorInfo ) ; } render ( ) { return this . props . children ; } }