diff --git a/components/error-boundary.tsx b/components/error-boundary.tsx index 40aa66a..becfe0a 100644 --- a/components/error-boundary.tsx +++ b/components/error-boundary.tsx @@ -127,9 +127,11 @@ export class ErrorBoundary extends Component { render() { const { hasError, error, errorInfo, showStackTrace } = this.state - const { children, fallback, level = 'component' } = this.props - const { hasError, error } = this.state - const { children, fallback, showDetails = process.env.NODE_ENV === 'development', level = 'component' } = this.props + const { + children, + fallback, + level = 'component', + } = this.props if (hasError && error) { if (fallback) { @@ -154,7 +156,7 @@ export class ErrorBoundary extends Component { renderAppLevelError() { const { error, errorInfo, showStackTrace } = this.state - const { showDetails } = this.props + const { showDetails = process.env.NODE_ENV === 'development' } = this.props return (
@@ -225,7 +227,7 @@ export class ErrorBoundary extends Component { renderPageLevelError() { const { error, errorInfo, showStackTrace } = this.state - const { showDetails } = this.props + const { showDetails = process.env.NODE_ENV === 'development' } = this.props return (
@@ -288,7 +290,7 @@ export class ErrorBoundary extends Component { renderSectionLevelError() { const { error } = this.state - const { showDetails } = this.props + const { showDetails = process.env.NODE_ENV === 'development' } = this.props return ( @@ -315,7 +317,7 @@ export class ErrorBoundary extends Component { renderComponentLevelError() { const { error } = this.state - const { showDetails } = this.props + const { showDetails = process.env.NODE_ENV === 'development' } = this.props return (