@sentry/react
Advanced tools
Comparing version 6.10.0 to 6.11.0
@@ -9,3 +9,3 @@ import { ReportDialogOptions, Scope } from '@sentry/browser'; | ||
resetError(): void; | ||
}) => React.ReactNode; | ||
}) => React.ReactElement; | ||
export declare type ErrorBoundaryProps = { | ||
@@ -27,3 +27,3 @@ /** If a Sentry report dialog should be rendered on error */ | ||
*/ | ||
fallback?: React.ReactNode | FallbackRender; | ||
fallback?: React.ReactElement | FallbackRender; | ||
/** Called with the error boundary encounters an error */ | ||
@@ -30,0 +30,0 @@ onError?(error: Error, componentStack: string, eventId: string): void; |
@@ -102,9 +102,16 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
if (error) { | ||
if (React.isValidElement(fallback)) { | ||
return fallback; | ||
} | ||
var element = undefined; | ||
if (typeof fallback === 'function') { | ||
return fallback({ error: error, componentStack: componentStack, resetError: this.resetErrorBoundary, eventId: eventId }); | ||
element = fallback({ error: error, componentStack: componentStack, resetError: this.resetErrorBoundary, eventId: eventId }); | ||
} | ||
// Fail gracefully if no fallback provided | ||
else { | ||
element = fallback; | ||
} | ||
if (React.isValidElement(element)) { | ||
return element; | ||
} | ||
if (fallback) { | ||
utils_1.logger.warn('fallback did not produce a valid ReactElement'); | ||
} | ||
// Fail gracefully if no fallback provided or is not valid | ||
return null; | ||
@@ -111,0 +118,0 @@ } |
@@ -9,3 +9,3 @@ import { ReportDialogOptions, Scope } from '@sentry/browser'; | ||
resetError(): void; | ||
}) => React.ReactNode; | ||
}) => React.ReactElement; | ||
export declare type ErrorBoundaryProps = { | ||
@@ -27,3 +27,3 @@ /** If a Sentry report dialog should be rendered on error */ | ||
*/ | ||
fallback?: React.ReactNode | FallbackRender; | ||
fallback?: React.ReactElement | FallbackRender; | ||
/** Called with the error boundary encounters an error */ | ||
@@ -30,0 +30,0 @@ onError?(error: Error, componentStack: string, eventId: string): void; |
import { __assign, __extends, __read, __spread } from "tslib"; | ||
import { captureEvent, captureException, eventFromException, showReportDialog, withScope, } from '@sentry/browser'; | ||
import { parseSemver } from '@sentry/utils'; | ||
import { logger, parseSemver } from '@sentry/utils'; | ||
import hoistNonReactStatics from 'hoist-non-react-statics'; | ||
@@ -101,9 +101,16 @@ import * as React from 'react'; | ||
if (error) { | ||
if (React.isValidElement(fallback)) { | ||
return fallback; | ||
} | ||
var element = undefined; | ||
if (typeof fallback === 'function') { | ||
return fallback({ error: error, componentStack: componentStack, resetError: this.resetErrorBoundary, eventId: eventId }); | ||
element = fallback({ error: error, componentStack: componentStack, resetError: this.resetErrorBoundary, eventId: eventId }); | ||
} | ||
// Fail gracefully if no fallback provided | ||
else { | ||
element = fallback; | ||
} | ||
if (React.isValidElement(element)) { | ||
return element; | ||
} | ||
if (fallback) { | ||
logger.warn('fallback did not produce a valid ReactElement'); | ||
} | ||
// Fail gracefully if no fallback provided or is not valid | ||
return null; | ||
@@ -110,0 +117,0 @@ } |
{ | ||
"name": "@sentry/react", | ||
"version": "6.10.0", | ||
"version": "6.11.0", | ||
"description": "Official Sentry SDK for React.js", | ||
@@ -19,6 +19,6 @@ "repository": "git://github.com/getsentry/sentry-javascript.git", | ||
"dependencies": { | ||
"@sentry/browser": "6.10.0", | ||
"@sentry/minimal": "6.10.0", | ||
"@sentry/types": "6.10.0", | ||
"@sentry/utils": "6.10.0", | ||
"@sentry/browser": "6.11.0", | ||
"@sentry/minimal": "6.11.0", | ||
"@sentry/types": "6.11.0", | ||
"@sentry/utils": "6.11.0", | ||
"hoist-non-react-statics": "^3.3.2", | ||
@@ -31,3 +31,3 @@ "tslib": "^1.9.3" | ||
"devDependencies": { | ||
"@sentry-internal/eslint-config-sdk": "6.10.0", | ||
"@sentry-internal/eslint-config-sdk": "6.11.0", | ||
"@testing-library/react": "^11.2.6", | ||
@@ -34,0 +34,0 @@ "@testing-library/react-hooks": "^5.1.1", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
197077
1763
+ Added@sentry/browser@6.11.0(transitive)
+ Added@sentry/core@6.11.0(transitive)
+ Added@sentry/hub@6.11.0(transitive)
+ Added@sentry/minimal@6.11.0(transitive)
+ Added@sentry/types@6.11.0(transitive)
+ Added@sentry/utils@6.11.0(transitive)
- Removed@sentry/browser@6.10.0(transitive)
- Removed@sentry/core@6.10.0(transitive)
- Removed@sentry/hub@6.10.0(transitive)
- Removed@sentry/minimal@6.10.0(transitive)
- Removed@sentry/types@6.10.0(transitive)
- Removed@sentry/utils@6.10.0(transitive)
Updated@sentry/browser@6.11.0
Updated@sentry/minimal@6.11.0
Updated@sentry/types@6.11.0
Updated@sentry/utils@6.11.0