mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/50499 We enocuntered an issue internally where the `RCTInstance` was ready before the modules were done registering statically. When this happens, it can occur that we iterate over an array that is going to be modified. With this change, we are introducing several changes: - By default the logs are not outputted, so the array is not going to be populated - we are making a copy of the array before we start iterating, so even if the original reference is updated, the iteration is safe - we are not emitting logs if in release mode. This will protect production from this issue. Also, these warns are not going to be useful in production anyway. ## Changelog: [Internal] - fix crash when RCTInstance is ready while modules are initialized ## Facebook: This fixes T220205371 Reviewed By: Abbondanzo Differential Revision: D72512518 fbshipit-source-id: 32e561111d034455a6a778d05af4a96602b74bfb