mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
1cef72af04
Summary: ## Description When the TurboModule and the NativeModule systems are alive at the same time, after RN cleanup, if a TurboModule is required, we return `null` from TurboModuleManager. This causes `CatalystInstanceImpl.getNativeModule` to do a lookup on NativeModule registry, which throws an `AssertionError`, because the TurboModule isn't found. Instead of throwing an `AssertionError` from `CatalystInstanceImpl.getNativeModule`, this diff instead has that method return `null` in this particular case. ## Rationale This should eliminate the crashes we're seeing in T46487253. ## Future action In the future, we should guard `CatalystInstanceImpl.getNativeModule` with an `if (mDestroyed) return null;` statement. This'll ensure that if NativeModules are required after React Native has started cleanup, they'll be returned as `null`. Right now, we either return the destroyed NativeModule object, or create/initialize the NativeMoulde and return it, which is wrong. Changelog: [Android][Changed] - Make CatalystInstance.getNativeModule nullable Reviewed By: JoshuaGross Differential Revision: D21272029 fbshipit-source-id: 099ad9ab9fa2146299df4cf7f86ae7a8e526bb15
Building React Native for Android
See the docs on the website.
Running tests
When you submit a pull request CircleCI will automatically run all tests. To run tests locally, see Testing.