diff --git a/packages/react-native/React/Views/RCTComponentData.m b/packages/react-native/React/Views/RCTComponentData.m index 52efad6e159..db6f9711426 100644 --- a/packages/react-native/React/Views/RCTComponentData.m +++ b/packages/react-native/React/Views/RCTComponentData.m @@ -365,24 +365,23 @@ static RCTPropBlock createNSInvocationSetter(NSMethodSignature *typeSignature, S } - (void)setProps:(NSDictionary *)props forView:(id)view +{ + [self setProps:props forView:view isShadowView:NO]; +} + +- (void)setProps:(NSDictionary *)props forShadowView:(RCTShadowView *)shadowView +{ + [self setProps:props forView:shadowView isShadowView:YES]; +} + +- (void)setProps:(NSDictionary *)props forView:(id)view isShadowView:(BOOL)isShadowView { if (!view) { return; } [props enumerateKeysAndObjectsUsingBlock:^(NSString *key, id json, __unused BOOL *stop) { - [self propBlockForKey:key isShadowView:NO](view, json); - }]; -} - -- (void)setProps:(NSDictionary *)props forShadowView:(RCTShadowView *)shadowView -{ - if (!shadowView) { - return; - } - - [props enumerateKeysAndObjectsUsingBlock:^(NSString *key, id json, __unused BOOL *stop) { - [self propBlockForKey:key isShadowView:YES](shadowView, json); + [self propBlockForKey:key isShadowView:isShadowView](view, json); }]; }