From 68de26851573e03d2fa34d4fcc20591f7e748202 Mon Sep 17 00:00:00 2001 From: Tilman Vatteroth Date: Tue, 26 Oct 2021 14:39:17 +0200 Subject: [PATCH] Fix type error in error-boundary.tsx Signed-off-by: Tilman Vatteroth --- src/components/error-boundary/error-boundary.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/error-boundary/error-boundary.tsx b/src/components/error-boundary/error-boundary.tsx index becc3aa1d..1b8cdf6d4 100644 --- a/src/components/error-boundary/error-boundary.tsx +++ b/src/components/error-boundary/error-boundary.tsx @@ -4,7 +4,7 @@ SPDX-License-Identifier: AGPL-3.0-only */ -import type { ErrorInfo, ReactElement, ReactNodeArray } from 'react' +import type { ErrorInfo, ReactNode } from 'react' import React, { Component } from 'react' import { Button, Container } from 'react-bootstrap' import links from '../../links.json' @@ -38,7 +38,7 @@ export class ErrorBoundary extends Component { window.location.reload() } - render(): ReactElement | undefined | null | string | number | boolean | Record | ReactNodeArray { + render(): ReactNode | undefined { if (this.state.hasError) { return ( @@ -62,7 +62,8 @@ export class ErrorBoundary extends Component { ) + } else { + return this.props.children } - return this.props.children } }