Skip to content

Fix compose views crashing inside RN Modal component. #51319

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aleqsio
Copy link
Contributor

@aleqsio aleqsio commented May 14, 2025

Summary:

This PR enables using ComposeView, in particular as used in expo-ui and other compose libraries, inside RN modals.

Without it, apps crash with a a client crash related to the ViewTreeLifecycleOwner.

With it, components inside expo-ui render correctly inside modals.

This change is applied inside RN Modal, instead of expo-ui internals, since we to set the appropriate fields on every new dialog mounted.

Relevant expo/expo issue: expo/expo#36816

Changelog:

[ANDROID][FIXED] – Fix compose views crashing inside RN Modal component.

Test Plan:

I tested a reproduction linked in the expo/expo issue – this change makes the app not crash.

@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 p: Expo Partner: Expo labels May 14, 2025
@aleqsio aleqsio marked this pull request as ready for review May 15, 2025 10:38
@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label May 15, 2025
@cortinico
Copy link
Contributor

Without it, apps crash with a a client crash related to the ViewTreeLifecycleOwner.

What's the crash? Can you provide the stacktrace?

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: Expo Partner: Expo 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.

3 participants