You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the Sentry ErrorBoundary as the default ErrorBoundary in my application, and want to wrap the lazy loading of a React module via React.lazy.
As per facebook/react#14254 (comment) this requires the Error Boundary to accept render props for it's children. The Sentry Error Boundary currently doesn't, but instead brings up 'Warning: Functions are not valid as a React child in React component' as any function passed in children is not called.
I've extended the Sentry ErrorBoundary locally, and added the following clause to the render method:
This seemingly works well, but it would be nice to have this available in the Sentry component itself. I'm happy to provide a pull request if that would help.
The text was updated successfully, but these errors were encountered:
Extend the ErroBoundary component to allow it to support render props
children. This means that patterns like the following are viable:
```jsx
<Sentry.ErrorBoundary>
{() => (
<Suspense fallback={<div>Loading...</div>}>
<Other />
</Suspense>
)}
</Sentry.ErrorBoundary>
```
Fixes#3052
Extend the ErrorBoundary component to allow it to support render props
children. This means that patterns like the following are viable:
```jsx
<Sentry.ErrorBoundary>
{() => (
<Suspense fallback={<div>Loading...</div>}>
<Other />
</Suspense>
)}
</Sentry.ErrorBoundary>
```
Fixes#3052
Extend the ErrorBoundary component to allow it to support render props
children. This means that patterns like the following are viable:
```jsx
<Sentry.ErrorBoundary>
{() => (
<Suspense fallback={<div>Loading...</div>}>
<Other />
</Suspense>
)}
</Sentry.ErrorBoundary>
```
Fixes#3052
Package + Version
@sentry/react
Version:
Description
I'm using the Sentry ErrorBoundary as the default ErrorBoundary in my application, and want to wrap the lazy loading of a React module via
React.lazy
.As per facebook/react#14254 (comment) this requires the Error Boundary to accept render props for it's children. The Sentry Error Boundary currently doesn't, but instead brings up 'Warning: Functions are not valid as a React child in React component' as any function passed in children is not called.
I've extended the Sentry ErrorBoundary locally, and added the following clause to the render method:
This seemingly works well, but it would be nice to have this available in the Sentry component itself. I'm happy to provide a pull request if that would help.
The text was updated successfully, but these errors were encountered: