import React from 'react' import ErrorDisplay from '~/components/errorDisplay' export default class ErrorBoundary extends React.Component { constructor(props) { super() this.state = {error: null}; } static getDerivedStateFromError(error){ return {error} } render() { if(this.state.error) return return this.props.children; } }