Skip to content

Commit 6386988

Browse files
RSNarafacebook-github-bot
authored andcommitted
Introduce BridgeReactContext < ReactApplicationContext (#43624)
Summary: Pull Request resolved: #43624 Eventually, we will move all bridge methods to BridgeReactContext. Long-term, ReactApplicationContext and ReactContext will become abstract. And these two contexts will only contain methods common to both modes. Changelog: [Android][Added] Introduce BridgeReactContext Reviewed By: cortinico Differential Revision: D55218592 fbshipit-source-id: 731d4940d492a1ed3f855c9a181d2a6f9eeb9623
1 parent fcddb16 commit 6386988

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

packages/react-native/ReactAndroid/api/ReactAndroid.api

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,10 @@ public abstract class com/facebook/react/bridge/BaseJavaModule : com/facebook/re
532532
public fun invalidate ()V
533533
}
534534

535+
public final class com/facebook/react/bridge/BridgeReactContext : com/facebook/react/bridge/ReactApplicationContext {
536+
public fun <init> (Landroid/content/Context;)V
537+
}
538+
535539
public abstract interface class com/facebook/react/bridge/Callback {
536540
public abstract fun invoke ([Ljava/lang/Object;)V
537541
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
package com.facebook.react.bridge
9+
10+
import android.content.Context
11+
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture
12+
13+
/**
14+
* This is the bridge-specific concrete subclass of ReactContext. ReactContext has many methods that
15+
* delegate to the react instance. This subclass will implement those methods, by delegating to the
16+
* CatalystInstance. If you need to create a ReactContext within an "bridge context", please create
17+
* BridgeReactContext.
18+
*/
19+
@DeprecatedInNewArchitecture
20+
class BridgeReactContext(base: Context) : ReactApplicationContext(base) {}

0 commit comments

Comments
 (0)