Skip to content

Commit ccfa0f7

Browse files
authored
fix(0.78): Fix the compilation failure caused by errorData[@"isFata… (#2468)
> ## Summary: > Fix Release build failure #2449 > Fix TextInput onBlur is invalid #2319 > ## Test Plan: > Run react-native-macos-init and check that the created project builds and run.
1 parent 9e09c45 commit ccfa0f7

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputView.mm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,13 @@ - (BOOL)textInputShouldBeginEditing
513513

514514
- (void)textInputDidBeginEditing
515515
{
516+
#if TARGET_OS_OSX // [macOS
517+
if (_isCurrentlyEditing) {
518+
return;
519+
}
520+
_isCurrentlyEditing = YES;
521+
#endif // macOS]
522+
516523
[_eventDispatcher sendTextEventWithType:RCTTextEventTypeFocus
517524
reactTag:self.reactTag
518525
text:[self.backedTextInputView.attributedText.string copy]

packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,11 @@ - (void)_handleJSError:(const JsErrorHandler::ProcessedError &)error withRuntime
524524
name:errorData[@"name"]
525525
componentStack:errorData[@"componentStack"]
526526
exceptionId:error.id
527-
isFatal:errorData[@"isFatal"]
527+
#if TARGET_OS_OSX // [macOS Use boolValue for isFatal to ensure type safety
528+
isFatal:[errorData[@"isFatal"] boolValue] // Explicitly convert to BOOL to avoid compiler errors on macOS
529+
#else
530+
isFatal:errorData[@"isFatal"]
531+
#endif // macOS]
528532
extraData:errorData[@"extraData"]]) {
529533
JS::NativeExceptionsManager::ExceptionData jsErrorData{errorData};
530534
id<NativeExceptionsManagerSpec> exceptionsManager = [_turboModuleManager moduleForName:"ExceptionsManager"];

0 commit comments

Comments
 (0)