mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-24 18:22:01 +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 withErrorBoundary(WrappedComponent, FallbackComponent) {
|
||||||
function ErrorBoundaryWrapper(props) {
|
function ErrorBoundaryWrapper(props) {
|
||||||
return (
|
return (
|
||||||
<ErrorBoundary
|
<ErrorBoundary
|
||||||
fallbackRender={FallbackComponent || null}
|
FallbackComponent={FallbackComponent || DefaultFallbackComponent}
|
||||||
onError={errorHandler}
|
onError={errorHandler}
|
||||||
>
|
>
|
||||||
<WrappedComponent {...props} />
|
<WrappedComponent {...props} />
|
||||||
|
|
Loading…
Reference in a new issue