Răsfoiți Sursa

Merge pull request #3204 from overleaf/msm-fix-default-error-boundary-renderer

Fixed default renderer for react error boundary

GitOrigin-RevId: 87f7d80385717db6c0222cd97ad373760c4e161c
Chrystal Maria Griffiths 6 ani în urmă
părinte
comite
f4bef24429

+ 5 - 1
services/web/frontend/js/infrastructure/error-boundary.js

@@ -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} />