better handling for settings ui errors

This commit is contained in:
Vendicated
2022-11-15 17:29:31 +01:00
parent eabbf7d9bd
commit b30508aef8
5 changed files with 60 additions and 4 deletions

View File

@ -102,11 +102,11 @@ const ErrorBoundary = LazyComponent(() => {
};
}) as
React.ComponentType<React.PropsWithChildren<Props>> & {
wrap<T extends JSX.IntrinsicAttributes = any>(Component: React.ComponentType<T>): React.ComponentType<T>;
wrap<T extends JSX.IntrinsicAttributes = any>(Component: React.ComponentType<T>, errorBoundaryProps?: Props): React.ComponentType<T>;
};
ErrorBoundary.wrap = Component => props => (
<ErrorBoundary>
ErrorBoundary.wrap = (Component, errorBoundaryProps) => props => (
<ErrorBoundary {...errorBoundaryProps}>
<Component {...props} />
</ErrorBoundary>
);