Skip to content

Commit 9f9fb39

Browse files
Dmitry Rykunfacebook-github-bot
authored andcommitted
Export Commands and Constants only if native view config interop is enabled
Summary: `Commands` and `Constants` should be set in native only if component data is instantiated via native view config interop layer. Changelog: [Internal] Differential Revision: D49684166
1 parent 5203354 commit 9f9fb39

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/react-native/React/Modules/RCTUIManager.m

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1489,9 +1489,10 @@ static void RCTMeasureLayout(RCTShadowView *view, RCTShadowView *ancestor, RCTRe
14891489
// lazifyViewManagerConfig function in JS. This fuction uses NativeModules global object that is not available in the
14901490
// New Architecture. To make native view configs work in the New Architecture we will populate these properties in
14911491
// native.
1492-
moduleConstants[@"Commands"] = viewConfig[@"Commands"];
1493-
moduleConstants[@"Constants"] = viewConfig[@"Constants"];
1494-
1492+
if (RCTGetUseNativeViewConfigsInBridgelessMode()) {
1493+
moduleConstants[@"Commands"] = viewConfig[@"Commands"];
1494+
moduleConstants[@"Constants"] = viewConfig[@"Constants"];
1495+
}
14951496
// Add direct events
14961497
for (NSString *eventName in viewConfig[@"directEvents"]) {
14971498
if (!directEvents[eventName]) {

0 commit comments

Comments
 (0)