mirror of
https://github.com/react/react-native.git
synced 2026-10-04 10:51:19 +08:00
Summary: In `CatalystInstanceImpl.destroy()`, we require the TurboModuleManager using the [following lines](https://fburl.com/diffusion/a4y6wbft): ``` final JSIModule turboModuleManager = ReactFeatureFlags.useTurboModules ? mJSIModuleRegistry.getModule(JSIModuleType.TurboModuleManager) : null; ``` For some strange reason, even though `ReactFeatureFlags.useTurboModules` is true, the TurboModuleManager isn't registered with mJSIModuleRegistry. I spent some time looking through the code, but I couldn't figure out why. These lines actually aren't necessary, so it's possible to fix the issue by simply working around it, which is what this diff does. We shouldn't have been double requiring the TurboModuleManager anyways, since `CatalystInstance.java` has a method to set the TurboModuleManager, which we call in `ReactInstanceManager.createReactContext`. ## Alternative approach I could push this diff to the next cut, and instead land a diff that adds debug information to the native crash. At the cost of a week, it may help us figure out why we're seeing the crash. Thoughts? cc fkgozali Reviewed By: fkgozali Differential Revision: D17636604 fbshipit-source-id: ecfff593dc6eb4ec4d5e331348b308bc7ab37966