type: type optimization (#38381)

Co-authored-by: jiang_chunqiao <chunqiao_jiang@icloud.com>
This commit is contained in:
咩咩 2022-11-04 15:33:01 +08:00 committed by GitHub
parent 53bea24110
commit e80e40b764
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,15 +7,14 @@ interface ErrorBoundaryProps {
children?: React.ReactNode;
}
export default class ErrorBoundary extends React.Component<
ErrorBoundaryProps,
{
error?: Error | null;
info: {
componentStack?: string;
};
}
> {
interface ErrorBoundaryStates {
error?: Error | null;
info?: {
componentStack?: string;
};
}
class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryStates> {
state = {
error: undefined,
info: {
@ -41,3 +40,5 @@ export default class ErrorBoundary extends React.Component<
return children;
}
}
export default ErrorBoundary;