@@ -282,25 +282,34 @@ - (void)setIsJSResponder:(BOOL)isJSResponder
282282}
283283
284284- (void )synchronouslyUpdateViewOnUIThread : (ReactTag)reactTag
285- changedProps : (NSDictionary * )props
285+ changedProps : (folly::dynamic )props
286286 componentDescriptor : (const ComponentDescriptor &)componentDescriptor
287287{
288288 RCTAssertMainQueue ();
289+ NSArray <NSString *> *propsKeysToBeUpdated = extractKeysFromFollyDynamic (props);
290+ bool updatesTransform = props.find (" transform" ) != props.items ().end ();
291+ bool updatesOpacity = props.find (" opacity" ) != props.items ().end ();
292+
289293 UIView<RCTComponentViewProtocol> *componentView = [_componentViewRegistry findComponentViewWithTag: reactTag];
294+ if (!componentView) {
295+ RCTLogWarn (@" Attempted to update view with tag %ld , but it no longer exists" , (long )reactTag);
296+ return ;
297+ }
298+
290299 SurfaceId surfaceId = RCTSurfaceIdForView (componentView);
291300 Props::Shared oldProps = [componentView props ];
292301 Props::Shared newProps = componentDescriptor.cloneProps (
293- PropsParserContext{surfaceId, *_contextContainer.get ()}, oldProps, RawProps (convertIdToFollyDynamic (props)));
302+ PropsParserContext{surfaceId, *_contextContainer.get ()}, oldProps, RawProps (std::move (props)));
294303
295304 NSSet <NSString *> *propKeys = componentView.propKeysManagedByAnimated_DO_NOT_USE_THIS_IS_BROKEN ?: [NSSet new ];
296- propKeys = [propKeys setByAddingObjectsFromArray: props.allKeys ];
305+ propKeys = [propKeys setByAddingObjectsFromArray: propsKeysToBeUpdated ];
297306 componentView.propKeysManagedByAnimated_DO_NOT_USE_THIS_IS_BROKEN = nil ;
298307 [componentView updateProps: newProps oldProps: oldProps];
299308 componentView.propKeysManagedByAnimated_DO_NOT_USE_THIS_IS_BROKEN = propKeys;
300309
301310 const auto &newViewProps = static_cast <const ViewProps &>(*newProps);
302311
303- if (props[ @" transform " ] ) {
312+ if (updatesTransform ) {
304313 auto layoutMetrics = LayoutMetrics ();
305314 layoutMetrics.frame .size .width = componentView.layer .bounds .size .width ;
306315 layoutMetrics.frame .size .height = componentView.layer .bounds .size .height ;
@@ -309,7 +318,7 @@ - (void)synchronouslyUpdateViewOnUIThread:(ReactTag)reactTag
309318 componentView.layer .transform = newTransform;
310319 }
311320 }
312- if (props[ @" opacity " ] && componentView.layer .opacity != (float )newViewProps.opacity ) {
321+ if (updatesOpacity && componentView.layer .opacity != (float )newViewProps.opacity ) {
313322 componentView.layer .opacity = newViewProps.opacity ;
314323 }
315324
0 commit comments