mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-24 03:23:10 +00:00
Merge pull request #3204 from overleaf/msm-fix-default-error-boundary-renderer
Fixed default renderer for react error boundary GitOrigin-RevId: 87f7d80385717db6c0222cd97ad373760c4e161c
This commit is contained in:
parent
8c739d96c6
commit
f4bef24429
1 changed files with 5 additions and 1 deletions
|
@ -10,11 +10,15 @@ function errorHandler(error, componentStack) {
|
|||
}
|
||||
}
|
||||
|
||||
function DefaultFallbackComponent() {
|
||||
return <></>
|
||||
}
|
||||
|
||||
function withErrorBoundary(WrappedComponent, FallbackComponent) {
|
||||
function ErrorBoundaryWrapper(props) {
|
||||
return (
|
||||
<ErrorBoundary
|
||||
fallbackRender={FallbackComponent || null}
|
||||
FallbackComponent={FallbackComponent || DefaultFallbackComponent}
|
||||
onError={errorHandler}
|
||||
>
|
||||
<WrappedComponent {...props} />
|
||||
|
|
Loading…
Reference in a new issue