Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Catching errors from an RCTRootView #1086
You can add a custom error handler by using RCTSetLogFunction(). This won't disable the RedBox (perhaps it should - TBD), however you can do that separately by setting RCT_DEBUG=0.
If you can think of a better solution that won't break existing expectations, I'd be happy to consider it.
In future, RCTRedBox is likely to become a module, so you'll be able to replace it by passing in an alternative module with the same name vis the moduleProvider block. For now, the only option that doesn't involve changing the RCT_DEBUG preprocessor flag would be to swizzle some methods in the RCTRedBox (we do this in some of our unit tests).