@synthesize bridge = _bridge
not working with bridgeless mode and TurboModule
#43479
Labels
Issue: Author Provided Repro
This issue can be reproduced in Snack or an attached project.
Type: New Architecture
Issues and PRs related to new architecture (Fabric/Turbo Modules)
Description
I'm developing a module that uses the bridge to access the
uiManager
and run code on the JS thread.I'm calling
@synthesize bridge = _bridge
to get a reference to the bridge in my module.When turning bridgeless mode on, the reference to the bridge is null.
This document specifies that we should get a
RCTBridgeProxy
, which is not the case.I've investigated a little bit and figured that the issue disappears when I remove
RCTTurboModule
from the protocols of the generated Spec module:Similarly, if I declare that my interface inherits
RCTBridgeModule
instead of my generated Spec, the issue is fixed.I've checked and this issue happens with RN 0.73.6 and 0.74.0-rc.3.
Steps to reproduce
I've created a repo containing a package and a sample app reproducing the issue: https://github.com/louiszawadzki/react-native-rn074-synthesize-issue
The installation and reproduction steps are in the README of this repo.
Run the app and check the iOS logs to see the value of the bridge.
React Native Version
0.74.0-rc.3
Affected Platforms
Runtime - iOS
Areas
Bridgeless - The New Initialization Flow
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://github.com/louiszawadzki/react-native-rn074-synthesize-issue
Screenshots and Videos
No response
The text was updated successfully, but these errors were encountered: