mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/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