From 7bb840d5d1e29d24a64b4fa8c9580929195e7172 Mon Sep 17 00:00:00 2001 From: Christoph Purrer Date: Thu, 12 Jan 2023 10:12:44 +0100 Subject: [PATCH] Fix compilation error in Schedule.cpp when building for rn-iOS + Fabric Due to an early cherry-pick from a more recent facebook/react-native version > https://github.com/microsoft/react-native-macos/pull/1498 this broke. In https://github.com/microsoft/react-native-macos/pull/1498 I must have only build for rn-iOS + Paper. I think we need a CircleCI job now for rn-iOS + Fabric Here is the fix. - std::optional's function signature is has_value() - where as folly::Optional used hasValue() In packages/rn-tester I ran: ``` USE_FABRIC=1 pod install ``` And then build and launched the app --- ReactCommon/react/renderer/scheduler/Scheduler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactCommon/react/renderer/scheduler/Scheduler.cpp b/ReactCommon/react/renderer/scheduler/Scheduler.cpp index e42f4b2a3fab40..57f40dcb161dee 100644 --- a/ReactCommon/react/renderer/scheduler/Scheduler.cpp +++ b/ReactCommon/react/renderer/scheduler/Scheduler.cpp @@ -61,7 +61,7 @@ Scheduler::Scheduler( contextContainer_->find>( "RuntimeScheduler"); auto runtimeScheduler = - (enableCallImmediates && weakRuntimeScheduler.hasValue()) + (enableCallImmediates && weakRuntimeScheduler.has_value()) ? weakRuntimeScheduler.value().lock() : nullptr;