diff options
| author | Haishan <[email protected]> | 2018-12-23 23:36:17 +0800 |
|---|---|---|
| committer | Haishan <[email protected]> | 2018-12-23 23:36:17 +0800 |
| commit | 38e5b480c0ae4af53bf734d65595fbdbf72dd2c1 (patch) | |
| tree | a94c01744d046629f8e80ba244ac556ce8cdd039 /src/components/ErrorBoundary.js | |
| parent | a72115067a8aee5dce75ad34a280a2588ac24c0e (diff) | |
feat: add a customized ErrorBoundaryFallback
Diffstat (limited to 'src/components/ErrorBoundary.js')
| -rw-r--r-- | src/components/ErrorBoundary.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/components/ErrorBoundary.js b/src/components/ErrorBoundary.js index a44ca92..892f524 100644 --- a/src/components/ErrorBoundary.js +++ b/src/components/ErrorBoundary.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { getSentry } from '../misc/sentry'; +import ErrorBoundaryFallback from 'c/ErrorBoundaryFallback'; // XXX this is no Hook equivalents for componentDidCatch // we have to use class for now @@ -42,9 +43,9 @@ class ErrorBoundary extends Component { render() { if (this.state.error) { //render fallback UI - return <a onClick={this.showReportDialog}>Report feedback</a>; + // return <a onClick={this.showReportDialog}>Report feedback</a>; + return <ErrorBoundaryFallback />; } else { - //when there's not an error, render children untouched return this.props.children; } } |
