import React, { ErrorInfo } from 'react' import { Button } from 'UI' class PlayerErrorBoundary extends React.Component { state = { hasError: false, error: '' }; constructor(props: any) { super(props); } componentDidCatch(error: Error, info: ErrorInfo) { this.setState({ hasError: true, error: error + info.componentStack }) } render() { if (this.state.hasError) { // You can render any custom fallback UI return (

Something went wrong during player rendering.

{this.state.error}

); } return this.props.children; } } export default PlayerErrorBoundary