MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / constructor

Method constructor

packages/react/src/errorboundary.tsx:100–115  ·  view source on GitHub ↗
(props: ErrorBoundaryProps)

Source from the content-addressed store, hash-verified

98 private _cleanupHook?: () => void;
99
100 public constructor(props: ErrorBoundaryProps) {
101 super(props);
102
103 this.state = INITIAL_STATE;
104 this._openFallbackReportDialog = true;
105
106 const client = getClient();
107 if (client && props.showDialog) {
108 this._openFallbackReportDialog = false;
109 this._cleanupHook = client.on('afterSendEvent', event => {
110 if (!event.type && this._lastEventId && event.event_id === this._lastEventId) {
111 showReportDialog({ ...props.dialogOptions, eventId: this._lastEventId });
112 }
113 });
114 }
115 }
116
117 public componentDidCatch(error: unknown, errorInfo: React.ErrorInfo): void {
118 const { componentStack } = errorInfo;

Callers

nothing calls this directly

Calls 3

getClientFunction · 0.90
showReportDialogFunction · 0.90
onMethod · 0.65

Tested by

no test coverage detected