-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Make the interop-layer work with components with custom name #41376
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly good, there are two chunks of code that must be removed.
RCTBridgeProxy *bridgeProxy; | ||
auto optionalBridgeProxy = contextContainer->find<std::shared_ptr<void>>("RCTBridgeProxy"); | ||
if (optionalBridgeProxy) { | ||
bridgeProxy = unwrapManagedObjectWeakly(optionalBridgeProxy.value()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This must be removed. 0.72 does not have bridgeless and thus it can't leverage the RCTBridgeProxy
class.
if (bridgeProxy != nil) { | ||
return [[bridgeProxy moduleForName:RCTNSStringFromString(componentName) lazilyLoadIfNecessary:YES] class]; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This must be removed. 0.72 does not have bridgeless and thus it can't leverage the RCTBridgeProxy class.
Summary: This should fix #37905 (comment) When working on react-native-fast-image, we realized that the interop layer does not work for components where the exported name is different from the iOS class. To fix this, we can use the Bridge to retrieve the actual view manager, given the component name. This solution should be much more robust than making assumptions on the ViewManager name, given the ComponentName. On top of that, we realized tha the interop layer was not calling `didSetProps` after setting the props, so we are invoking that. bypass-github-export-checks [iOS][Fixed] - Add support for Components with custom names in the interop layer. Pull Request resolved: #41207 Test Plan: Tested locally on an app created in 0.72 and 0.73 in Bridge and Bridgeless mode. Reviewed By: cortinico Differential Revision: D50698172 Pulled By: cipolleschi fbshipit-source-id: 49aee905418515b0204febbbe6a67c0114f37029
e40af84
to
61bd291
Compare
Base commit: 47f773e |
Summary:
Cherry-pick of daedbe6.
Created a PR as the commit caused merge conflicts in the 0.72-stable branch.
Changelog:
[iOS][Fixed] - Add support for Components with custom names in the interop layer.
Test Plan:
See: #41207