types: Make ErrorBoundary.wrap explicitly return Function

This commit is contained in:
Vendicated 2023-03-28 19:06:58 +02:00
parent eb318c678f
commit 337b3709d6
No known key found for this signature in database
GPG key ID: A1DC0CFB5615D905

View file

@ -105,7 +105,7 @@ const ErrorBoundary = LazyComponent(() => {
};
}) as
React.ComponentType<React.PropsWithChildren<Props>> & {
wrap<T extends object = any>(Component: React.ComponentType<T>, errorBoundaryProps?: Omit<Props<T>, "wrappedProps">): React.ComponentType<T>;
wrap<T extends object = any>(Component: React.ComponentType<T>, errorBoundaryProps?: Omit<Props<T>, "wrappedProps">): React.FunctionComponent<T>;
};
ErrorBoundary.wrap = (Component, errorBoundaryProps) => props => (