react-native-exception-handler icon indicating copy to clipboard operation
react-native-exception-handler copied to clipboard

the Component will unmount method

Open rahuljain88 opened this issue 5 years ago • 6 comments

Hello ,

I initiated this package in index.js as per given steps.

I testes this.test() in app.js file , the output we are getting in error object is right , but when i created component folder added one button.js inside component .

I used this.test() inside button.js file , not getting proper error object , it's always saying "Component will unmount method " and is fatal getting undefined .

Can you please help me ?

rahuljain88 avatar May 21 '19 09:05 rahuljain88

I am not really sure if I get this right. Can you please give a link to a sample repo with the issue ?

a7ul avatar May 21 '19 09:05 a7ul

Hey master-(atul),

Thanks for your quick response.

Could you please let me know how I can capture error from nested components?

E.g. App -> Header -> Navigation If I have above hierarchy of component and there is an reference error in Navigation component. Then how library will capture that error?

rahuljain88 avatar May 21 '19 09:05 rahuljain88

"Uncaught Errors" are bubbled up. So setting an error handler on the root should catch them even if errors come from sub components.

But if you are catching these errors by means of a try catch or componentDidCatch etc, then those are no longer "Uncaught errors" and wont be picked up by the global error handler.

This is the expected behaviour of the module. I am not really sure if that is what you were expecting?

a7ul avatar May 21 '19 10:05 a7ul

Thank you so much for your help ..

I am sharing my sample to you .. I have initialized react-native-exception-handler package in index.js , In home.js i used {this.test()} function...

For login you can used any id or password like - [email protected] & 1234 password.

https://github.com/rahuljain88/React-Exception-Handling-Test

Thanks again

rahuljain88 avatar May 21 '19 13:05 rahuljain88

i have the same problem, how to solve it? can't got the right error and have the red error background

EternalChildren avatar May 23 '19 09:05 EternalChildren

I saw this as well - and I believe this is due to warnings becoming red box errors. Not sure yet how to solve it.

tparesi avatar Nov 15 '19 18:11 tparesi