Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(react): Support render props in ErrorBoundary #3793

Merged
merged 1 commit into from
Jul 12, 2021

Conversation

AbhiPrasad
Copy link
Member

Extend the ErrorBoundary component to allow it to support render props
children. This means that patterns like the following are viable:

<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
@github-actions
Copy link
Contributor

github-actions bot commented Jul 9, 2021

size-limit report

Path Size
@sentry/browser - CDN Bundle (gzipped) 21.43 KB (-0.01% 🔽)
@sentry/browser - Webpack 22.46 KB (0%)
@sentry/react - Webpack 22.49 KB (0%)
@sentry/browser + @sentry/tracing - CDN Bundle (gzipped) 28.92 KB (-0.01% 🔽)

@kamilogorek kamilogorek merged commit 3095f4b into master Jul 12, 2021
@kamilogorek kamilogorek deleted the abhi-react-child-func branch July 12, 2021 08:49
@kamilogorek
Copy link
Contributor

Merged to include in the release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extend React ErrorBoundary component to accept render props for children
2 participants