From 5625d63e46c43132676148a86739025c15fa5f2d Mon Sep 17 00:00:00 2001 From: megumin Date: Mon, 17 Oct 2022 20:18:25 +0100 Subject: Settings 2.0 (#107) Co-authored-by: Vendicated --- src/components/ErrorBoundary.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/components/ErrorBoundary.tsx') diff --git a/src/components/ErrorBoundary.tsx b/src/components/ErrorBoundary.tsx index c62acb0..bb0c336 100644 --- a/src/components/ErrorBoundary.tsx +++ b/src/components/ErrorBoundary.tsx @@ -5,6 +5,7 @@ import { ErrorCard } from "./ErrorCard"; interface Props { fallback?: React.ComponentType>; onError?(error: Error, errorInfo: React.ErrorInfo): void; + message?: string; } const color = "#e78284"; @@ -58,15 +59,14 @@ export default class ErrorBoundary extends React.Component; + const msg = this.props.message || "An error occurred while rendering this Component. More info can be found below and in your console."; + return (

Oh no!

-

- An error occurred while rendering this Component. More info can be found below - and in your console. -

+

{msg}

{this.state.message} {!!this.state.stack && ( -- cgit