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

Prevent iOS host object installation from getting the wrong bridge #2146

Conversation

gabrieldonadel
Copy link
Contributor

Description

Similar to software-mansion/react-native-reanimated#5953, using [RCTBridge currentBridge] may lead to the wrong bridge in apps that have multiple React instances, as is the case for expo-dev-client. This results in apps sometimes crashing when reloading the bundle after interacting with the DevMenu.

image

Changes

Instead of using [RCTBridge currentBridge] we can just call self.bridge and ensure the correct bridge is always used

@kkafar kkafar requested review from WoLewicki and kkafar May 20, 2024 11:29
@kkafar
Copy link
Member

kkafar commented May 20, 2024

Hey @gabrieldonadel, thanks for noticing this and taking your time to fix this.
I'll be asking @WoLewicki to take a look at these changes as he is well-versed with bridgeless mode.

Copy link
Member

@WoLewicki WoLewicki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, I made a PR changing it some time ago: #2120 but it is stuck with some problems in core. I think we can merge that one to fix at least one of the issues already 🚀

@WoLewicki WoLewicki merged commit 4f6f974 into software-mansion:main May 21, 2024
5 checks passed
@gabrieldonadel gabrieldonadel deleted the @gabrieldonadel/fix-installing-host-object branch May 21, 2024 09:21
ja1ns pushed a commit to WiseOwlTech/react-native-screens that referenced this pull request Oct 9, 2024
…oftware-mansion#2146)


Similar to
software-mansion/react-native-reanimated#5953,
using `[RCTBridge currentBridge]` may lead to the wrong bridge in apps
that have multiple React instances, as is the case for expo-dev-client.
This results in apps sometimes crashing when reloading the bundle after
interacting with the DevMenu.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants