File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -72,11 +72,20 @@ private void findMethods() {
7272 Class <? extends NativeModule > superClass =
7373 (Class <? extends NativeModule >) classForMethods .getSuperclass ();
7474 if (TurboModule .class .isAssignableFrom (superClass )) {
75- // For java module that is based on generated flow-type spec, inspect the
76- // spec abstract class instead, which is the super class of the given java
77- // module.
78- classForMethods = superClass ;
75+ // Check if the parent class also conforms to ReactModuleWithSpec
76+ // this accounts for cases when a module is extended i.e. Expo's sandbox AsyncStorage and Intent module.
77+ Class <? extends NativeModule > superSuperClass =
78+ (Class <? extends NativeModule >) superClass .getSuperclass ();
79+ if (TurboModule .class .isAssignableFrom (superSuperClass )) {
80+ classForMethods = superSuperClass ;
81+ } else {
82+ // For java module that is based on generated flow-type spec, inspect the
83+ // spec abstract class instead, which is the super class of the given java
84+ // module.
85+ classForMethods = superClass ;
86+ }
7987 }
88+
8089 Method [] targetMethods = classForMethods .getDeclaredMethods ();
8190
8291 for (Method targetMethod : targetMethods ) {
You can’t perform that action at this time.
0 commit comments