Fix for iOS displaying a RedBox for LogBox handled errors (#32641)

Summary:
Fix for iOS displaying a RedBox for LogBox handled errors, this has been happening since RN 0.65 (in 64.2 and earlier, if it was handled by LogBox then it wouldn't trigger RedBox)

Fixes https://github.com/facebook/react-native/issues/32106

## Changelog

[iOS] [Fixed] - Stop RedBox from appearing for LogBox handled errors

Pull Request resolved: https://github.com/facebook/react-native/pull/32641

Test Plan: Manually tested. Seems to fix things (and RedBox still displays for things like 'Could not connect to development server') but I would appreciate RSNara or someone else who is more familiar with the code to confirm that the original switch was a mistake and not something deliberately changed.

Reviewed By: christophpurrer

Differential Revision: D33661481

Pulled By: cortinico

fbshipit-source-id: c9c262adb3f977ae3f13beb9575d3eaa2445f663
This commit is contained in:
Liam Jones
2022-01-19 12:17:03 -08:00
committed by Facebook GitHub Bot
parent 3a07dcf81e
commit 9d2df5b8ae
+1 -1
View File
@@ -91,7 +91,7 @@ RCT_EXPORT_METHOD(updateExceptionMessage
: (double)exceptionId)
{
RCTRedBox *redbox = [_moduleRegistry moduleForName:"RedBox"];
[redbox showErrorMessage:message withStack:stack errorCookie:(int)exceptionId];
[redbox updateErrorMessage:message withStack:stack errorCookie:(int)exceptionId];
if (_delegate && [_delegate respondsToSelector:@selector(updateJSExceptionWithMessage:stack:exceptionId:)]) {
[_delegate updateJSExceptionWithMessage:message stack:stack exceptionId:[NSNumber numberWithDouble:exceptionId]];