1 import PropTypes from 'prop-types';
2 import React from 'react';
4 class ErrorBoundary extends React.Component {
12 static getDerivedStateFromError(error) {
16 componentDidCatch(error, errorInfo) {
17 console.log(error, errorInfo);
21 const { children } = this.props;
22 const { error } = this.state;
30 ErrorBoundary.propTypes = {
31 children: PropTypes.node,
34 export default ErrorBoundary;