7272
7373` react-native link react-native-exception-handler `
7474
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+
7580### Manual installation
7681
7782#### iOS
@@ -156,7 +161,7 @@ To catch **Native_Exceptions**
156161import { setNativeExceptionHandler } from " react-native-exception-handler" ;
157162
158163// For most use cases:
159- setNativeExceptionHandler (exceptionString => {
164+ setNativeExceptionHandler (( exceptionString ) => {
160165 // This is your custom global error handler
161166 // You do stuff likehit google analytics to track crashes.
162167 // or hit a custom api to inform the dev team.
@@ -165,7 +170,7 @@ setNativeExceptionHandler(exceptionString => {
165170});
166171// ====================================================
167172// ADVANCED use case:
168- const exceptionhandler = exceptionString => {
173+ const exceptionhandler = ( exceptionString ) => {
169174 // your exception handler code here
170175};
171176setNativeExceptionHandler (
@@ -416,7 +421,7 @@ import { Alert } from "react-native";
416421import { BackAndroid } from " react-native" ;
417422import { setJSExceptionHandler } from " react-native-exception-handler" ;
418423
419- const reporter = error = > {
424+ const reporter = ( error) = > {
420425 // Logic for reporting to devs
421426 // Example : Log issues to github issues using github apis.
422427 console. log(error); // sample
@@ -437,8 +442,8 @@ const errorHandler = (e, isFatal) => {
437442 text: " Close" ,
438443 onPress: () = > {
439444 BackAndroid . exitApp();
440- }
441- }
445+ },
446+ },
442447 ]
443448 );
444449 } else {
@@ -448,7 +453,7 @@ const errorHandler = (e, isFatal) => {
448453
449454setJSExceptionHandler (errorHandler );
450455
451- setNativeExceptionHandler (errorString => {
456+ setNativeExceptionHandler (( errorString ) => {
452457 // You can do something like call an api to report to dev team here
453458 // example
454459 // fetch('http://<YOUR API TO REPORT TO DEV TEAM>?error='+errorString);
0 commit comments