a7ul / react-native-exception-handler

A react native module that lets you to register a global error handler that can capture fatal/non fatal uncaught exceptions.
MIT License
1.58k stars 133 forks source link

Seeing "Check the render method of `PageName`" JS exceptions #139

Open Aung-Myint-Thein opened 4 years ago

Aung-Myint-Thein commented 4 years ago

Thanks for making this great library. I just started using the library for our app. We have class based screens as well as Hook screens. I am getting Check the render method of xxx JS exceptions in my console for my hook screens. However, I don't see any other warning or errors in my console.

I added following codes in my index.js file

const errorHandler = (e, isFatal) => {
  if (isFatal) {
    Alert.alert(
      'Unexpected error occurred',
      `
        Error: ${isFatal ? 'Fatal:' : ''} ${e.name} ${e.message}
        We have reported this to our team ! Please close the app and start again!
        `,
      [
        {
          text: 'Close',
        },
      ],
    );
  } else {
    // eslint-disable-next-line no-console
    console.log(e); // So that we can see it in the ADB logs in case of Android if needed
  }
};

setJSExceptionHandler(errorHandler, true, true);

I didn't ignore any warning in my LogBox. So, if there is any warning or errors, I should be seeing them in console. Am I missing something? Thanks.

I am using

"react-native": "0.63.2", "react-native-exception-handler": "^2.10.8",

pavelgorbach commented 3 years ago

+1

activebiz commented 3 years ago

+1