mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
d43059d0b8
Summary: ## Problem For efficiency reasons, we'd only check whether the current class or its superclass implemented the `TurboModule` interface. However, it's possible for NativeModules to exist that use inheritance, and have their base class extend a code-generated spec. In this case, the superclass of the superclass of the NativeModule will implement `TurboModule`. ## Solution To fix this problem, I'm relying on the `Types.isAssignable` API and checking whether the NativeModule can be assigned to the `TurboModule` interface. This is a more reliable way of knowing whether a NativeModule is a TurboModule or not. **Note:** Had to adjust the buck dependencies of FrescoModule to make the `mTypes.isAssignable` check work. Changelog: [Android][Fixed] - Correct TurboModule detection logic in ReactModuleSpecProcessor Reviewed By: fkgozali Differential Revision: D19183671 fbshipit-source-id: ad21881453fe7027d9432048108f6ba344fd7e63