-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
React Activity exposes ReactHost (#46980)
Summary: Pull Request resolved: #46980 Changelog: [Android][Added] React Activity exposes ReactHost **Context:** *These changes will not impact `DefaultReactHost` which is the way most OSS apps interface with `ReactHost`* * We are simplifying `ReactHost` and `ReactHostDelegate` for Brownfield uses. * We fetch the `ReactHost` to create the `ReactDelegate` https://www.internalfb.com/code/fbsource/[00ee07afc695]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java?lines=110-112 * With Bridgeless, you must use or extend `ReactHostDelegate` to get the `ReactHost` since we don't expose a getter on `ReactActivity`. * If there is a custom Application, then getting the `ReactHost` will need a custom implementation. * For the base case, we shouldn't need to subclass the delegate. **Change:** * Expose `ReactHost` on `ReactActivity` for Bridgeless access. * Expose `ReactActivity` on `ReactActivityDelegate`. This will help us avoid keeping a reference to Activity in each subclass. * Update the RN Android API's Reviewed By: arushikesarwani94 Differential Revision: D64150994 fbshipit-source-id: a9d790a4b4ce4eca29dee4bdc8d9fc56cf742f1f
- Loading branch information
1 parent
398512a
commit d78cb78
Showing
3 changed files
with
19 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters