From 9d2df5b8ae95b3cfeae26f64bd1d50bd2b0bbae9 Mon Sep 17 00:00:00 2001 From: Liam Jones Date: Wed, 19 Jan 2022 12:15:33 -0800 Subject: [PATCH] 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 --- React/CoreModules/RCTExceptionsManager.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/React/CoreModules/RCTExceptionsManager.mm b/React/CoreModules/RCTExceptionsManager.mm index e5bbbab2f92cd5..ca1aafca6d4a34 100644 --- a/React/CoreModules/RCTExceptionsManager.mm +++ b/React/CoreModules/RCTExceptionsManager.mm @@ -91,7 +91,7 @@ - (void)reportFatal:(NSString *)message stack:(NSArray *)stack e : (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]];