Skip to content

Commit ff963ee

Browse files
Saadnajmiclaude
andcommitted
fix: wrap setGhostText command dispatch in TARGET_OS_OSX guard
The command dispatch was calling [componentView setGhostText:] unconditionally, but the protocol method is only declared under #if TARGET_OS_OSX. This caused iOS and visionOS builds to fail with "no known instance method for selector". Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9da4c7d commit ff963ee

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputNativeCommands.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ RCTTextInputHandleCommand(id<RCTTextInputViewProtocol> componentView, const NSSt
9999
return;
100100
}
101101

102-
if ([commandName isEqualToString:@"setGhostText"]) { // [macOS
102+
#if TARGET_OS_OSX // [macOS
103+
if ([commandName isEqualToString:@"setGhostText"]) {
103104
#if RCT_DEBUG
104105
if ([args count] != 1) {
105106
RCTLogError(
@@ -112,7 +113,8 @@ RCTTextInputHandleCommand(id<RCTTextInputViewProtocol> componentView, const NSSt
112113
NSString *value = [arg0 isKindOfClass:[NSNull class]] ? nil : (NSString *)arg0;
113114
[componentView setGhostText:value];
114115
return;
115-
} // macOS]
116+
}
117+
#endif // macOS]
116118

117119
#if RCT_DEBUG
118120
RCTLogError(@"%@ received command %@, which is not a supported command.", @"TextInput", commandName);

0 commit comments

Comments
 (0)