@microsoft/applicationinsights-react-js 19.3.9-nightly.2604-01 → 19.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/applicationinsights-react-js.js +19 -25
- package/browser/applicationinsights-react-js.js.map +1 -1
- package/browser/applicationinsights-react-js.min.js +2 -2
- package/browser/applicationinsights-react-js.min.js.map +1 -1
- package/dist/applicationinsights-react-js.api.json +19 -40
- package/dist/applicationinsights-react-js.api.md +11 -14
- package/dist/applicationinsights-react-js.d.ts +20 -21
- package/dist/applicationinsights-react-js.js +19 -25
- package/dist/applicationinsights-react-js.js.map +1 -1
- package/dist/applicationinsights-react-js.min.js +2 -2
- package/dist/applicationinsights-react-js.min.js.map +1 -1
- package/dist/applicationinsights-react-js.rollup.d.ts +20 -21
- package/dist-esm/AppInsightsContext.js +1 -1
- package/dist-esm/AppInsightsErrorBoundary.js +13 -8
- package/dist-esm/AppInsightsErrorBoundary.js.map +1 -1
- package/dist-esm/Interfaces/IReactExtensionConfig.js +1 -1
- package/dist-esm/ReactPlugin.js +7 -6
- package/dist-esm/ReactPlugin.js.map +1 -1
- package/dist-esm/applicationinsights-react-js.js +1 -1
- package/dist-esm/useTrackEvent.js +1 -1
- package/dist-esm/useTrackMetric.js +1 -1
- package/dist-esm/withAITracking.js +5 -5
- package/dist-esm/withAITracking.js.map +1 -1
- package/package.json +79 -83
- package/src/AppInsightsErrorBoundary.tsx +17 -8
- package/src/ReactPlugin.ts +13 -13
- package/src/withAITracking.tsx +5 -5
- package/types/AppInsightsErrorBoundary.d.ts +5 -5
- package/types/ReactPlugin.d.ts +4 -5
- package/types/tsdoc-metadata.json +1 -1
- package/types/withAITracking.d.ts +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"metadata": {
|
|
3
3
|
"toolPackage": "@microsoft/api-extractor",
|
|
4
|
-
"toolVersion": "7.
|
|
4
|
+
"toolVersion": "7.58.1",
|
|
5
5
|
"schemaVersion": 1011,
|
|
6
6
|
"oldestForwardsCompatibleVersion": 1001,
|
|
7
7
|
"tsdocConfig": {
|
|
@@ -852,21 +852,8 @@
|
|
|
852
852
|
},
|
|
853
853
|
{
|
|
854
854
|
"kind": "Reference",
|
|
855
|
-
"text": "React.
|
|
856
|
-
"canonicalReference": "@types/react!React.
|
|
857
|
-
},
|
|
858
|
-
{
|
|
859
|
-
"kind": "Content",
|
|
860
|
-
"text": "<unknown, string | "
|
|
861
|
-
},
|
|
862
|
-
{
|
|
863
|
-
"kind": "Reference",
|
|
864
|
-
"text": "React.JSXElementConstructor",
|
|
865
|
-
"canonicalReference": "@types/react!React.JSXElementConstructor:type"
|
|
866
|
-
},
|
|
867
|
-
{
|
|
868
|
-
"kind": "Content",
|
|
869
|
-
"text": "<any>>"
|
|
855
|
+
"text": "React.ReactNode",
|
|
856
|
+
"canonicalReference": "@types/react!React.ReactNode:type"
|
|
870
857
|
},
|
|
871
858
|
{
|
|
872
859
|
"kind": "Content",
|
|
@@ -876,7 +863,7 @@
|
|
|
876
863
|
"isStatic": false,
|
|
877
864
|
"returnTypeTokenRange": {
|
|
878
865
|
"startIndex": 1,
|
|
879
|
-
"endIndex":
|
|
866
|
+
"endIndex": 2
|
|
880
867
|
},
|
|
881
868
|
"releaseTag": "Public",
|
|
882
869
|
"isProtected": false,
|
|
@@ -896,8 +883,9 @@
|
|
|
896
883
|
"text": "state: "
|
|
897
884
|
},
|
|
898
885
|
{
|
|
899
|
-
"kind": "
|
|
900
|
-
"text": "
|
|
886
|
+
"kind": "Reference",
|
|
887
|
+
"text": "IAppInsightsErrorBoundaryState",
|
|
888
|
+
"canonicalReference": "@microsoft/applicationinsights-react-js!~IAppInsightsErrorBoundaryState:interface"
|
|
901
889
|
},
|
|
902
890
|
{
|
|
903
891
|
"kind": "Content",
|
|
@@ -1148,15 +1136,6 @@
|
|
|
1148
1136
|
"text": "IConfiguration",
|
|
1149
1137
|
"canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration:interface"
|
|
1150
1138
|
},
|
|
1151
|
-
{
|
|
1152
|
-
"kind": "Content",
|
|
1153
|
-
"text": " & "
|
|
1154
|
-
},
|
|
1155
|
-
{
|
|
1156
|
-
"kind": "Reference",
|
|
1157
|
-
"text": "IConfig",
|
|
1158
|
-
"canonicalReference": "@microsoft/applicationinsights-core-js!IConfig:interface"
|
|
1159
|
-
},
|
|
1160
1139
|
{
|
|
1161
1140
|
"kind": "Content",
|
|
1162
1141
|
"text": ", core: "
|
|
@@ -1203,8 +1182,8 @@
|
|
|
1203
1182
|
],
|
|
1204
1183
|
"isStatic": false,
|
|
1205
1184
|
"returnTypeTokenRange": {
|
|
1206
|
-
"startIndex":
|
|
1207
|
-
"endIndex":
|
|
1185
|
+
"startIndex": 10,
|
|
1186
|
+
"endIndex": 11
|
|
1208
1187
|
},
|
|
1209
1188
|
"releaseTag": "Public",
|
|
1210
1189
|
"isProtected": false,
|
|
@@ -1214,31 +1193,31 @@
|
|
|
1214
1193
|
"parameterName": "config",
|
|
1215
1194
|
"parameterTypeTokenRange": {
|
|
1216
1195
|
"startIndex": 1,
|
|
1217
|
-
"endIndex":
|
|
1196
|
+
"endIndex": 2
|
|
1218
1197
|
},
|
|
1219
1198
|
"isOptional": false
|
|
1220
1199
|
},
|
|
1221
1200
|
{
|
|
1222
1201
|
"parameterName": "core",
|
|
1223
1202
|
"parameterTypeTokenRange": {
|
|
1224
|
-
"startIndex":
|
|
1225
|
-
"endIndex":
|
|
1203
|
+
"startIndex": 3,
|
|
1204
|
+
"endIndex": 4
|
|
1226
1205
|
},
|
|
1227
1206
|
"isOptional": false
|
|
1228
1207
|
},
|
|
1229
1208
|
{
|
|
1230
1209
|
"parameterName": "extensions",
|
|
1231
1210
|
"parameterTypeTokenRange": {
|
|
1232
|
-
"startIndex":
|
|
1233
|
-
"endIndex":
|
|
1211
|
+
"startIndex": 5,
|
|
1212
|
+
"endIndex": 7
|
|
1234
1213
|
},
|
|
1235
1214
|
"isOptional": false
|
|
1236
1215
|
},
|
|
1237
1216
|
{
|
|
1238
1217
|
"parameterName": "pluginChain",
|
|
1239
1218
|
"parameterTypeTokenRange": {
|
|
1240
|
-
"startIndex":
|
|
1241
|
-
"endIndex":
|
|
1219
|
+
"startIndex": 8,
|
|
1220
|
+
"endIndex": 9
|
|
1242
1221
|
},
|
|
1243
1222
|
"isOptional": true
|
|
1244
1223
|
}
|
|
@@ -1280,11 +1259,11 @@
|
|
|
1280
1259
|
{
|
|
1281
1260
|
"kind": "Method",
|
|
1282
1261
|
"canonicalReference": "@microsoft/applicationinsights-react-js!ReactPlugin#processTelemetry:member(1)",
|
|
1283
|
-
"docComment": "/**\n * Add Part A fields to the event\n *\n * @param
|
|
1262
|
+
"docComment": "/**\n * Add Part A fields to the event\n *\n * @param env - The event that needs to be processed\n */\n",
|
|
1284
1263
|
"excerptTokens": [
|
|
1285
1264
|
{
|
|
1286
1265
|
"kind": "Content",
|
|
1287
|
-
"text": "processTelemetry(
|
|
1266
|
+
"text": "processTelemetry(env: "
|
|
1288
1267
|
},
|
|
1289
1268
|
{
|
|
1290
1269
|
"kind": "Reference",
|
|
@@ -1323,7 +1302,7 @@
|
|
|
1323
1302
|
"overloadIndex": 1,
|
|
1324
1303
|
"parameters": [
|
|
1325
1304
|
{
|
|
1326
|
-
"parameterName": "
|
|
1305
|
+
"parameterName": "env",
|
|
1327
1306
|
"parameterTypeTokenRange": {
|
|
1328
1307
|
"startIndex": 1,
|
|
1329
1308
|
"endIndex": 2
|
|
@@ -8,22 +8,21 @@ import { BaseTelemetryPlugin } from '@microsoft/applicationinsights-core-js';
|
|
|
8
8
|
import { Context } from 'react';
|
|
9
9
|
import { Dispatch } from 'react';
|
|
10
10
|
import { History as History_2 } from 'history';
|
|
11
|
-
import { IAppInsights } from '@microsoft/applicationinsights-
|
|
11
|
+
import { IAppInsights } from '@microsoft/applicationinsights-core-js';
|
|
12
12
|
import { IAppInsightsCore } from '@microsoft/applicationinsights-core-js';
|
|
13
|
-
import { IConfig } from '@microsoft/applicationinsights-common';
|
|
14
13
|
import { IConfiguration } from '@microsoft/applicationinsights-core-js';
|
|
15
14
|
import { ICookieMgr } from '@microsoft/applicationinsights-core-js';
|
|
16
15
|
import { ICustomProperties } from '@microsoft/applicationinsights-core-js';
|
|
17
|
-
import { IEventTelemetry } from '@microsoft/applicationinsights-
|
|
18
|
-
import { IExceptionTelemetry } from '@microsoft/applicationinsights-
|
|
19
|
-
import { IMetricTelemetry } from '@microsoft/applicationinsights-
|
|
20
|
-
import { IPageViewTelemetry } from '@microsoft/applicationinsights-
|
|
16
|
+
import { IEventTelemetry } from '@microsoft/applicationinsights-core-js';
|
|
17
|
+
import { IExceptionTelemetry } from '@microsoft/applicationinsights-core-js';
|
|
18
|
+
import { IMetricTelemetry } from '@microsoft/applicationinsights-core-js';
|
|
19
|
+
import { IPageViewTelemetry } from '@microsoft/applicationinsights-core-js';
|
|
21
20
|
import { IPlugin } from '@microsoft/applicationinsights-core-js';
|
|
22
21
|
import { IProcessTelemetryContext } from '@microsoft/applicationinsights-core-js';
|
|
23
|
-
import { ITelemetryContext } from '@microsoft/applicationinsights-
|
|
22
|
+
import { ITelemetryContext } from '@microsoft/applicationinsights-core-js';
|
|
24
23
|
import { ITelemetryItem } from '@microsoft/applicationinsights-core-js';
|
|
25
24
|
import { ITelemetryPluginChain } from '@microsoft/applicationinsights-core-js';
|
|
26
|
-
import { ITraceTelemetry } from '@microsoft/applicationinsights-
|
|
25
|
+
import { ITraceTelemetry } from '@microsoft/applicationinsights-core-js';
|
|
27
26
|
import * as React_2 from 'react';
|
|
28
27
|
import { default as React_3 } from 'react';
|
|
29
28
|
import { SetStateAction } from 'react';
|
|
@@ -72,11 +71,9 @@ export class AppInsightsErrorBoundary extends React_3.Component<IAppInsightsErro
|
|
|
72
71
|
// (undocumented)
|
|
73
72
|
componentDidCatch(error: Error, errorInfo: React_3.ErrorInfo): void;
|
|
74
73
|
// (undocumented)
|
|
75
|
-
render(): React_3.
|
|
74
|
+
render(): React_3.ReactNode;
|
|
76
75
|
// (undocumented)
|
|
77
|
-
state:
|
|
78
|
-
hasError: boolean;
|
|
79
|
-
};
|
|
76
|
+
state: IAppInsightsErrorBoundaryState;
|
|
80
77
|
}
|
|
81
78
|
|
|
82
79
|
// @public
|
|
@@ -94,10 +91,10 @@ export class ReactPlugin extends BaseTelemetryPlugin {
|
|
|
94
91
|
// (undocumented)
|
|
95
92
|
identifier: string;
|
|
96
93
|
// (undocumented)
|
|
97
|
-
initialize(config: IConfiguration
|
|
94
|
+
initialize(config: IConfiguration, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain): void;
|
|
98
95
|
// (undocumented)
|
|
99
96
|
priority: number;
|
|
100
|
-
processTelemetry(
|
|
97
|
+
processTelemetry(env: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
|
|
101
98
|
// (undocumented)
|
|
102
99
|
trackEvent(event: IEventTelemetry, customProperties?: ICustomProperties): void;
|
|
103
100
|
// (undocumented)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Microsoft Application Insights react plugin, 19.
|
|
2
|
+
* Microsoft Application Insights react plugin, 19.4.0
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* Microsoft Application Insights Team
|
|
@@ -11,22 +11,21 @@ declare namespace ApplicationInsights {
|
|
|
11
11
|
import { Context } from 'react';
|
|
12
12
|
import { Dispatch } from 'react';
|
|
13
13
|
import { History as History_2 } from 'history';
|
|
14
|
-
import { IAppInsights } from '@microsoft/applicationinsights-
|
|
14
|
+
import { IAppInsights } from '@microsoft/applicationinsights-core-js';
|
|
15
15
|
import { IAppInsightsCore } from '@microsoft/applicationinsights-core-js';
|
|
16
|
-
import { IConfig } from '@microsoft/applicationinsights-common';
|
|
17
16
|
import { IConfiguration } from '@microsoft/applicationinsights-core-js';
|
|
18
17
|
import { ICookieMgr } from '@microsoft/applicationinsights-core-js';
|
|
19
18
|
import { ICustomProperties } from '@microsoft/applicationinsights-core-js';
|
|
20
|
-
import { IEventTelemetry } from '@microsoft/applicationinsights-
|
|
21
|
-
import { IExceptionTelemetry } from '@microsoft/applicationinsights-
|
|
22
|
-
import { IMetricTelemetry } from '@microsoft/applicationinsights-
|
|
23
|
-
import { IPageViewTelemetry } from '@microsoft/applicationinsights-
|
|
19
|
+
import { IEventTelemetry } from '@microsoft/applicationinsights-core-js';
|
|
20
|
+
import { IExceptionTelemetry } from '@microsoft/applicationinsights-core-js';
|
|
21
|
+
import { IMetricTelemetry } from '@microsoft/applicationinsights-core-js';
|
|
22
|
+
import { IPageViewTelemetry } from '@microsoft/applicationinsights-core-js';
|
|
24
23
|
import { IPlugin } from '@microsoft/applicationinsights-core-js';
|
|
25
24
|
import { IProcessTelemetryContext } from '@microsoft/applicationinsights-core-js';
|
|
26
|
-
import { ITelemetryContext } from '@microsoft/applicationinsights-
|
|
25
|
+
import { ITelemetryContext } from '@microsoft/applicationinsights-core-js';
|
|
27
26
|
import { ITelemetryItem } from '@microsoft/applicationinsights-core-js';
|
|
28
27
|
import { ITelemetryPluginChain } from '@microsoft/applicationinsights-core-js';
|
|
29
|
-
import { ITraceTelemetry } from '@microsoft/applicationinsights-
|
|
28
|
+
import { ITraceTelemetry } from '@microsoft/applicationinsights-core-js';
|
|
30
29
|
import * as React_2 from 'react';
|
|
31
30
|
import { default as React_3 } from 'react';
|
|
32
31
|
import { SetStateAction } from 'react';
|
|
@@ -58,11 +57,9 @@ declare namespace ApplicationInsights {
|
|
|
58
57
|
const AppInsightsContext: AppInsightsReactContext;
|
|
59
58
|
|
|
60
59
|
class AppInsightsErrorBoundary extends React_3.Component<IAppInsightsErrorBoundaryProps, IAppInsightsErrorBoundaryState> {
|
|
61
|
-
state:
|
|
62
|
-
hasError: boolean;
|
|
63
|
-
};
|
|
60
|
+
state: IAppInsightsErrorBoundaryState;
|
|
64
61
|
componentDidCatch(error: Error, errorInfo: React_3.ErrorInfo): void;
|
|
65
|
-
render(): React_3.
|
|
62
|
+
render(): React_3.ReactNode;
|
|
66
63
|
}
|
|
67
64
|
|
|
68
65
|
type AppInsightsReactContext = Context<ReactPlugin>;
|
|
@@ -70,11 +67,13 @@ declare namespace ApplicationInsights {
|
|
|
70
67
|
interface IAppInsightsErrorBoundaryProps {
|
|
71
68
|
appInsights: ReactPlugin;
|
|
72
69
|
onError: React_3.ComponentType<any>;
|
|
73
|
-
children: React_3.
|
|
70
|
+
children: React_3.ReactNode;
|
|
74
71
|
}
|
|
75
72
|
|
|
76
73
|
interface IAppInsightsErrorBoundaryState {
|
|
77
74
|
hasError: boolean;
|
|
75
|
+
error: Error | null;
|
|
76
|
+
errorInfo: React_3.ErrorInfo | null;
|
|
78
77
|
}
|
|
79
78
|
|
|
80
79
|
/**
|
|
@@ -95,7 +94,7 @@ declare namespace ApplicationInsights {
|
|
|
95
94
|
identifier: string;
|
|
96
95
|
readonly context: ITelemetryContext;
|
|
97
96
|
constructor();
|
|
98
|
-
initialize(config: IConfiguration
|
|
97
|
+
initialize(config: IConfiguration, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain): void;
|
|
99
98
|
/**
|
|
100
99
|
* Get the current cookie manager for this instance
|
|
101
100
|
*/
|
|
@@ -106,9 +105,9 @@ declare namespace ApplicationInsights {
|
|
|
106
105
|
getAppInsights(): IAppInsights;
|
|
107
106
|
/**
|
|
108
107
|
* Add Part A fields to the event
|
|
109
|
-
* @param
|
|
108
|
+
* @param env The event that needs to be processed
|
|
110
109
|
*/
|
|
111
|
-
processTelemetry(
|
|
110
|
+
processTelemetry(env: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
|
|
112
111
|
trackMetric(metric: IMetricTelemetry, customProperties: ICustomProperties): void;
|
|
113
112
|
trackPageView(pageView: IPageViewTelemetry): void;
|
|
114
113
|
trackEvent(event: IEventTelemetry, customProperties?: ICustomProperties): void;
|
|
@@ -126,10 +125,10 @@ declare namespace ApplicationInsights {
|
|
|
126
125
|
* Higher-order component function to hook Application Insights tracking
|
|
127
126
|
* in a React component's lifecycle.
|
|
128
127
|
*
|
|
129
|
-
* @param reactPlugin ReactPlugin instance
|
|
130
|
-
* @param Component the React component to be instrumented
|
|
131
|
-
* @param componentName (optional) component name
|
|
132
|
-
* @param className (optional) className of the HOC div
|
|
128
|
+
* @param reactPlugin - ReactPlugin instance
|
|
129
|
+
* @param Component - the React component to be instrumented
|
|
130
|
+
* @param componentName - (optional) component name
|
|
131
|
+
* @param className - (optional) className of the HOC div
|
|
133
132
|
*/
|
|
134
133
|
function withAITracking<P>(reactPlugin: ReactPlugin, Component: React_2.ComponentType<P>, componentName?: string, className?: string): React_2.ComponentClass<P>;
|
|
135
134
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Application Insights JavaScript SDK - React Plugin, 19.
|
|
2
|
+
* Application Insights JavaScript SDK - React Plugin, 19.4.0
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
(function (global, factory) {
|
|
@@ -265,19 +265,6 @@
|
|
|
265
265
|
}
|
|
266
266
|
var objDefineProp = ( _pureRef(ObjClass, "defineProperty"));
|
|
267
267
|
var objDefineProperties = ( _pureRef(ObjClass, "defineProperties"));
|
|
268
|
-
function objDefineAccessors(target, prop, getProp, setProp, configurable, enumerable) {
|
|
269
|
-
var desc = {
|
|
270
|
-
e: enumerable,
|
|
271
|
-
c: configurable
|
|
272
|
-
};
|
|
273
|
-
if (getProp) {
|
|
274
|
-
desc.g = getProp;
|
|
275
|
-
}
|
|
276
|
-
if (setProp) {
|
|
277
|
-
desc.s = setProp;
|
|
278
|
-
}
|
|
279
|
-
return objDefineProp(target, prop, _createProp(desc));
|
|
280
|
-
}
|
|
281
268
|
function objDefine(target, key, propDesc) {
|
|
282
269
|
return objDefineProp(target, key, _createProp(propDesc));
|
|
283
270
|
}
|
|
@@ -1708,7 +1695,7 @@
|
|
|
1708
1695
|
return result;
|
|
1709
1696
|
}
|
|
1710
1697
|
|
|
1711
|
-
var version = '3.4.
|
|
1698
|
+
var version = '3.4.1';
|
|
1712
1699
|
var instanceName = "." + newId(6);
|
|
1713
1700
|
var _dataUid = 0;
|
|
1714
1701
|
function _canAcceptData(target) {
|
|
@@ -2445,7 +2432,7 @@
|
|
|
2445
2432
|
return _InternalLogMessage;
|
|
2446
2433
|
}());
|
|
2447
2434
|
function safeGetLogger(core, config) {
|
|
2448
|
-
return (core || {})[_DYN_LOGGER ] || new DiagnosticLogger(config);
|
|
2435
|
+
return (core || {})[_DYN_LOGGER ] || new DiagnosticLogger(config || (core || {})[_DYN_CONFIG ]);
|
|
2449
2436
|
}
|
|
2450
2437
|
var DiagnosticLogger = /** @class */ (function () {
|
|
2451
2438
|
function DiagnosticLogger(config) {
|
|
@@ -3683,8 +3670,8 @@
|
|
|
3683
3670
|
return safeGetCookieMgr(_self.core);
|
|
3684
3671
|
};
|
|
3685
3672
|
_self.getAppInsights = _getAnalytics;
|
|
3686
|
-
_self.processTelemetry = function (
|
|
3687
|
-
_self.processNext(
|
|
3673
|
+
_self.processTelemetry = function (env, itemCtx) {
|
|
3674
|
+
_self.processNext(env, itemCtx);
|
|
3688
3675
|
};
|
|
3689
3676
|
_self._doTeardown = function (unloadCtx, unloadState, asyncCallback) {
|
|
3690
3677
|
if (isFunction(_unlisten)) {
|
|
@@ -3733,7 +3720,9 @@
|
|
|
3733
3720
|
};
|
|
3734
3721
|
_unlisten = history.listen(locationListener);
|
|
3735
3722
|
}
|
|
3736
|
-
|
|
3723
|
+
objDefine(_self, "_extensionConfig", {
|
|
3724
|
+
g: function () { return _extensionConfig; }
|
|
3725
|
+
});
|
|
3737
3726
|
});
|
|
3738
3727
|
return _this;
|
|
3739
3728
|
}
|
|
@@ -3837,11 +3826,15 @@
|
|
|
3837
3826
|
__extendsFn(AppInsightsErrorBoundary, _super);
|
|
3838
3827
|
function AppInsightsErrorBoundary() {
|
|
3839
3828
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
3840
|
-
_this.state = {
|
|
3829
|
+
_this.state = {
|
|
3830
|
+
hasError: false,
|
|
3831
|
+
error: null,
|
|
3832
|
+
errorInfo: null,
|
|
3833
|
+
};
|
|
3841
3834
|
return _this;
|
|
3842
3835
|
}
|
|
3843
3836
|
AppInsightsErrorBoundary.prototype.componentDidCatch = function (error, errorInfo) {
|
|
3844
|
-
this.setState({ hasError: true });
|
|
3837
|
+
this.setState({ hasError: true, error: error, errorInfo: errorInfo });
|
|
3845
3838
|
this.props.appInsights.trackException({
|
|
3846
3839
|
error: error,
|
|
3847
3840
|
exception: error,
|
|
@@ -3850,11 +3843,12 @@
|
|
|
3850
3843
|
});
|
|
3851
3844
|
};
|
|
3852
3845
|
AppInsightsErrorBoundary.prototype.render = function () {
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3846
|
+
var _a = this.state, hasError = _a.hasError, error = _a.error, errorInfo = _a.errorInfo;
|
|
3847
|
+
var _b = this.props, onError = _b.onError, children = _b.children;
|
|
3848
|
+
if (hasError) {
|
|
3849
|
+
return React__default["default"].createElement(onError, { error: error, errorInfo: errorInfo });
|
|
3856
3850
|
}
|
|
3857
|
-
return
|
|
3851
|
+
return children;
|
|
3858
3852
|
};
|
|
3859
3853
|
return AppInsightsErrorBoundary;
|
|
3860
3854
|
}(React__default["default"].Component));
|