diff --git a/packages/react-native-reanimated/apple/reanimated/apple/REANodesManager.mm b/packages/react-native-reanimated/apple/reanimated/apple/REANodesManager.mm index 692070c575b..ccf1dc69fde 100644 --- a/packages/react-native-reanimated/apple/reanimated/apple/REANodesManager.mm +++ b/packages/react-native-reanimated/apple/reanimated/apple/REANodesManager.mm @@ -8,6 +8,12 @@ #import #import +#if REACT_NATIVE_MINOR_VERSION < 81 +#import +#endif + +using namespace facebook::react; + @implementation REANodesManager { READisplayLink *_displayLink; NSMutableArray *_onAnimationCallbacks; @@ -157,19 +163,22 @@ - (void)maybeFlushUIUpdatesQueue - (void)synchronouslyUpdateUIProps:(ReactTag)viewTag props:(const folly::dynamic &)props { -#if !TARGET_OS_OSX RCTAssertMainQueue(); RCTSurfacePresenter *surfacePresenter = self.surfacePresenter; RCTComponentViewRegistry *componentViewRegistry = surfacePresenter.mountingManager.componentViewRegistry; - UIView *componentView = [componentViewRegistry findComponentViewWithTag:viewTag]; + REAUIView *componentView = + [componentViewRegistry findComponentViewWithTag:static_cast(viewTag)]; NSSet *propKeysManagedByAnimated = [componentView propKeysManagedByAnimated_DO_NOT_USE_THIS_IS_BROKEN]; +#if REACT_NATIVE_MINOR_VERSION >= 81 [surfacePresenter schedulerDidSynchronouslyUpdateViewOnUIThread:viewTag props:props]; +#else + [surfacePresenter synchronouslyUpdateViewOnUIThread:@(viewTag) props:convertFollyDynamicToId(props)]; +#endif [componentView setPropKeysManagedByAnimated_DO_NOT_USE_THIS_IS_BROKEN:propKeysManagedByAnimated]; // `synchronouslyUpdateViewOnUIThread` does not flush props like `backgroundColor` etc. // so that's why we need to call `finalizeUpdates` here. [componentView finalizeUpdates:RNComponentViewUpdateMask{}]; -#endif // !TARGET_OS_OSX } @end