chore: Upgrade to React 18 (#495)

* chore: Upgrade to React 18

* runfix: Add children type to FC components

* chore: Remove @types/react
This commit is contained in:
Tatius Titus
2023-04-07 12:59:44 +08:00
committed by GitHub
parent fb7b1800cc
commit 30c2680b6f
8 changed files with 56 additions and 40 deletions
+6 -1
View File
@@ -1,3 +1,4 @@
import { ReactNode } from "react";
import { ErrorBoundary, FallbackProps } from "react-error-boundary";
function ErrorFallback({ error }: FallbackProps) {
@@ -9,7 +10,11 @@ function ErrorFallback({ error }: FallbackProps) {
);
}
export const BaseErrorBoundary: React.FC = (props) => {
interface BaseErrorBoundaryProps {
children?: ReactNode;
}
export const BaseErrorBoundary: React.FC<BaseErrorBoundaryProps> = (props) => {
return (
<ErrorBoundary FallbackComponent={ErrorFallback}>
{props.children}