mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix cxx codegen handling of optional return types (#36581)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/36581 Found that the current codegen did not properly handle a return type of `?bool` because the branch of `constexpr (is_optional_v<T>)` assumed that T was always a JSI value that needed conversion, and `supportsToJs<bool, bool>` is false. Changelog: [General][Fixed] Issue with TurboModule C++ codegen with optional return types Reviewed By: christophpurrer Differential Revision: D44302352 fbshipit-source-id: 0863de06da4e5e3c18f8a1ced7179d76d8e87b99
This commit is contained in:
committed by
Facebook GitHub Bot
parent
da027dd2fd
commit
dd6d57eea1
@@ -70,7 +70,7 @@ export interface Spec extends TurboModule {
|
||||
+getValue: (x: number, y: string, z: ObjectStruct) => ValueStruct;
|
||||
+getValueWithCallback: (callback: (value: string) => void) => void;
|
||||
+getValueWithPromise: (error: boolean) => Promise<string>;
|
||||
+getWithWithOptionalArgs: (optionalArg?: boolean) => boolean;
|
||||
+getWithWithOptionalArgs: (optionalArg?: boolean) => ?boolean;
|
||||
+voidFunc: () => void;
|
||||
+emitCustomDeviceEvent: (eventName: string) => void;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user