From 40dca3f0dbf17f8cb805308c48476a2d5d47ad5f Mon Sep 17 00:00:00 2001 From: Ruslan Shestopalyuk Date: Wed, 30 Aug 2023 04:44:23 -0700 Subject: [PATCH] Only include missing native module once in the TurboModuleRegistry debug reporting (#39207) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/39207 ## Changelog: [Internal] - Fixes a minor annoyance, whereas if a native module implementation is missing, then it may spam the "NotFound" list with many entries. Reviewed By: javache Differential Revision: D48819392 fbshipit-source-id: 6962375ada5f1889be61c9879c8fc07dd2286c3d --- .../react-native/Libraries/TurboModule/TurboModuleRegistry.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/Libraries/TurboModule/TurboModuleRegistry.js b/packages/react-native/Libraries/TurboModule/TurboModuleRegistry.js index e52cd1abdee..c8d6ad63df8 100644 --- a/packages/react-native/Libraries/TurboModule/TurboModuleRegistry.js +++ b/packages/react-native/Libraries/TurboModule/TurboModuleRegistry.js @@ -59,7 +59,7 @@ function requireModule(name: string): ?T { } } - if (shouldReportDebugInfo()) { + if (shouldReportDebugInfo() && !moduleLoadHistory.NotFound.includes(name)) { moduleLoadHistory.NotFound.push(name); } return null;