72
72
73
73
` react-native link react-native-exception-handler `
74
74
75
+ ### For [email protected] or above
76
+
77
+ As
[ [email protected] ] ( https://reactnative.dev/blog/2019/07/03/version-60 ) or above supports autolinking, so there is no need to run linking process.
78
+ Read more about autolinking [ here] ( https://github.com/react-native-picker/cli/blob/master/docs/autolinking.md ) .
79
+
75
80
### Manual installation
76
81
77
82
#### iOS
@@ -156,7 +161,7 @@ To catch **Native_Exceptions**
156
161
import { setNativeExceptionHandler } from " react-native-exception-handler" ;
157
162
158
163
// For most use cases:
159
- setNativeExceptionHandler (exceptionString => {
164
+ setNativeExceptionHandler (( exceptionString ) => {
160
165
// This is your custom global error handler
161
166
// You do stuff likehit google analytics to track crashes.
162
167
// or hit a custom api to inform the dev team.
@@ -165,7 +170,7 @@ setNativeExceptionHandler(exceptionString => {
165
170
});
166
171
// ====================================================
167
172
// ADVANCED use case:
168
- const exceptionhandler = exceptionString => {
173
+ const exceptionhandler = ( exceptionString ) => {
169
174
// your exception handler code here
170
175
};
171
176
setNativeExceptionHandler (
@@ -416,7 +421,7 @@ import { Alert } from "react-native";
416
421
import { BackAndroid } from " react-native" ;
417
422
import { setJSExceptionHandler } from " react-native-exception-handler" ;
418
423
419
- const reporter = error = > {
424
+ const reporter = ( error) = > {
420
425
// Logic for reporting to devs
421
426
// Example : Log issues to github issues using github apis.
422
427
console. log(error); // sample
@@ -437,8 +442,8 @@ const errorHandler = (e, isFatal) => {
437
442
text: " Close" ,
438
443
onPress: () = > {
439
444
BackAndroid . exitApp();
440
- }
441
- }
445
+ },
446
+ },
442
447
]
443
448
);
444
449
} else {
@@ -448,7 +453,7 @@ const errorHandler = (e, isFatal) => {
448
453
449
454
setJSExceptionHandler (errorHandler );
450
455
451
- setNativeExceptionHandler (errorString => {
456
+ setNativeExceptionHandler (( errorString ) => {
452
457
// You can do something like call an api to report to dev team here
453
458
// example
454
459
// fetch('http://<YOUR API TO REPORT TO DEV TEAM>?error='+errorString);
0 commit comments