noibu-react-native 0.0.3 → 0.0.4
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/README.md +5 -0
- package/dist/monitors/errorMonitor.js +3 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -27,6 +27,11 @@ Install using favourite node package manager (npm, yarn, etc.):
|
|
|
27
27
|
npm install noibu-react-native --save
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
+
Additionally, for iOS target do:
|
|
31
|
+
```bash
|
|
32
|
+
npx pod-install
|
|
33
|
+
```
|
|
34
|
+
|
|
30
35
|
## Usage
|
|
31
36
|
|
|
32
37
|
Call a setup method and wrap your root App component into SDK ErrorBoundary:
|
|
@@ -122,10 +122,12 @@ function configureEventListeners() {
|
|
|
122
122
|
function monitorErrors() {
|
|
123
123
|
// wrapping all listeners as soon as possible after we set the above listener
|
|
124
124
|
configureEventListeners();
|
|
125
|
-
global.ErrorUtils.
|
|
125
|
+
const existingHandler = global.ErrorUtils.getGlobalHandler() || (() => { });
|
|
126
|
+
global.ErrorUtils.setGlobalHandler((error, ...rest) => {
|
|
126
127
|
saveErrorToPagevisit(ERROR_EVENT_ERROR_TYPE, {
|
|
127
128
|
error,
|
|
128
129
|
});
|
|
130
|
+
return existingHandler(error, ...rest);
|
|
129
131
|
});
|
|
130
132
|
if (global.HermesInternal) {
|
|
131
133
|
global.HermesInternal.enablePromiseRejectionTracker({
|
package/package.json
CHANGED