better handling for settings ui errors
This commit is contained in:
parent
eabbf7d9bd
commit
b30508aef8
5 changed files with 60 additions and 4 deletions
|
|
@ -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>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue