import React from 'react'; import RocketIcon from './stats/modals/rocket-icon' export default class ErrorBoundary extends React.Component { constructor(props) { super(props); this.state = {error: null} } static getDerivedStateFromError(error) { return {error: error} } render() { if (this.state.error) { return (
Oops! Something went wrong
{this.state.error.name + ': ' + this.state.error.message}
) } return this.props.children; } }