Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public interface RCTDeviceEventEmitter extends JavaScriptModule {
private @Nullable JSExceptionHandler mExceptionHandlerWrapper;
private @Nullable WeakReference<Activity> mCurrentActivity;

private @Nullable InteropModuleRegistry mInteropModuleRegistry;
protected @Nullable InteropModuleRegistry mInteropModuleRegistry;
private boolean mIsInitialized = false;

public ReactContext(Context base) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.facebook.react.bridge.ReactNoCrashBridgeNotAllowedSoftException;
import com.facebook.react.bridge.ReactSoftExceptionLogger;
import com.facebook.react.bridge.WritableNativeArray;
import com.facebook.react.config.ReactFeatureFlags;
import com.facebook.react.devsupport.interfaces.DevSupportManager;
import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;
import com.facebook.react.uimanager.events.EventDispatcher;
Expand Down Expand Up @@ -49,6 +50,9 @@ class BridgelessReactContext extends ReactApplicationContext implements EventDis
BridgelessReactContext(Context context, ReactHostImpl host) {
super(context);
mReactHost = host;
if (ReactFeatureFlags.unstable_useFabricInterop) {
initializeInteropModules();
}
}

@Override
Expand Down Expand Up @@ -124,6 +128,10 @@ public BridgelessJSModuleInvocationHandler(

@Override
public <T extends JavaScriptModule> T getJSModule(Class<T> jsInterface) {
if (mInteropModuleRegistry != null
&& mInteropModuleRegistry.shouldReturnInteropModule(jsInterface)) {
return mInteropModuleRegistry.getInteropModule(jsInterface);
}
JavaScriptModule interfaceProxy =
(JavaScriptModule)
Proxy.newProxyInstance(
Expand Down