Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make reactHost accessible #48338

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

WoLewicki
Copy link
Contributor

Summary:

On bridgeless mode, reactHost is kept in memory even after destroying the DefaultReactNativeHost in brownfield scenario. Since it keeps references to the modules, they are not deallocated, and their initialize methods are not fired again when creating new instance of react-native later. It breaks the behavior of e.g. react-native-screens, which wants to listen for mutations and should get new FabricUIManager: https://github.com/software-mansion/react-native-screens/blob/20b7e83782cd5f79ddd0d61dadc13eeb4db4b258/android/src/main/java/com/swmansion/rnscreens/ScreensModule.kt#L45.

By making the variable public, we can make it null when destroying the RN activity, removing references to everything it kept.

Changelog:

[ANDROID] [FIXED] - make it possible to set reactHost to null.

Test Plan:

It shouldn't change anything since it is just change of visibility in the variable.

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Software Mansion Partner: Software Mansion Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Software Mansion Partner: Software Mansion Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants