Monday, 18 January 2021

Is it possible to get the line number of an error in React Native?

I am writing a React Native app, and I find that the error messages that the iOS emulator generates never indicate the line in my code where the error occurred. In the screenshot below, I can see that this is a problem with the map() function in the Dashboard component, but since it doesn't give a line number, if there are multiple instances of map() in Dashboard, I don't know how to isolate which one is throwing the error. So my question is:

Can anyone explain why React Native doesn't indicate the line number in this scenario? Is this an inherent property of how React Native works and it will always be impossible to identify the given line (if so, please explain why in as much detail as possible)? Or is there a way I can build my app differently in order to show the line numbers of errors?

Thanks!

enter image description here



from Is it possible to get the line number of an error in React Native?

No comments:

Post a Comment