mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-17 17:32:15 +08:00
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:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user