From e08ff320e697bf0d3fa664ee1ba87334c721d386 Mon Sep 17 00:00:00 2001 From: Dmytrii Puzyr Date: Mon, 16 Feb 2026 09:58:19 +0200 Subject: [PATCH 1/2] Change `@escaping` promise callbacks to raw type signature --- packages/core/ios/Sources/DdFlagsImplementation.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/core/ios/Sources/DdFlagsImplementation.swift b/packages/core/ios/Sources/DdFlagsImplementation.swift index f2e4cc59f..d5f638651 100644 --- a/packages/core/ios/Sources/DdFlagsImplementation.swift +++ b/packages/core/ios/Sources/DdFlagsImplementation.swift @@ -53,8 +53,9 @@ public class DdFlagsImplementation: NSObject { return client } + // Using @escaping RCTPromiseResolveBlock type will result in an issue when compiling the Swift header file. @objc - public func setEvaluationContext(_ clientName: String, targetingKey: String, attributes: NSDictionary, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) { + public func setEvaluationContext(_ clientName: String, targetingKey: String, attributes: NSDictionary, resolve: @escaping ((Any?) -> Void), reject: @escaping ((String?, String?, NSError?) -> Void)) { let client = getClient(name: clientName) guard let clientInternal = client as? FlagsClientInternal else { reject(nil, "CLIENT_NOT_INITIALIZED", nil) @@ -90,7 +91,7 @@ public class DdFlagsImplementation: NSObject { case .networkError: errorCode = "NETWORK_ERROR" } - reject(nil, errorCode, error) + reject(nil, errorCode, error as NSError) } } } From e70f20549a4ce521d72c3376b7a99f256a3a7286 Mon Sep 17 00:00:00 2001 From: Dmytrii Puzyr Date: Mon, 16 Feb 2026 11:02:30 +0200 Subject: [PATCH 2/2] Replace the `??=` operator with an older alternative --- packages/core/src/flags/DdFlags.ts | 4 +++- packages/react-native-openfeature/src/provider.ts | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/core/src/flags/DdFlags.ts b/packages/core/src/flags/DdFlags.ts index cb4ed4dbc..43714d598 100644 --- a/packages/core/src/flags/DdFlags.ts +++ b/packages/core/src/flags/DdFlags.ts @@ -45,7 +45,9 @@ class DdFlagsWrapper implements DdFlagsType { ); } - this.clients[clientName] ??= new FlagsClient(clientName); + if (!this.clients[clientName]) { + this.clients[clientName] = new FlagsClient(clientName); + } return this.clients[clientName]; }; diff --git a/packages/react-native-openfeature/src/provider.ts b/packages/react-native-openfeature/src/provider.ts index 2950b3101..6cbae29ca 100644 --- a/packages/react-native-openfeature/src/provider.ts +++ b/packages/react-native-openfeature/src/provider.ts @@ -48,7 +48,10 @@ export class DatadogOpenFeatureProvider implements Provider { private contextChangePromise = Promise.resolve(); constructor(options: DatadogOpenFeatureProviderOptions = {}) { - options.clientName ??= 'default'; + if (!options.clientName) { + options.clientName = 'default'; + } + this.options = options; this.flagsClient = DdFlags.getClient(this.options.clientName);