carloscuesta/react-native-error-boundary

Disable red screen in dev mode [question]

johkade opened this issue · 1 comments

Thanks for this helpful library!

I have a somewhat related question.

So by default, RN shows a (dismissible) "Red Screen" when an error is caught by an error-boundary.
Since this behavior is annoying for testing/development, I wanted to disable the red screen if possible.

I've looked for possible solutions (e.g. here), but haven't found one that would work.

Maybe if there was a solution, it could even be integrated into this library? I'd be happy to submit a PR if someone gave me a hint into the right direction :-)

Cheers!

Hey!

Looks like in 0.70 it's possible to disable the LogBox in Development by using:

LogBox.ignoreAllLogs()

As mentioned here in the docs:

https://reactnative.dev/docs/debugging

I don't think we really need to integrate this into the API of the library as it's only useful for Development, you can always dismiss it with the Esc key and can be disabled programatically with a React-Native built-in API.

Thanks!