@@ -298,7 +298,6 @@ - (void)registerRootView:(RCTRootContentView *)rootView
298
298
RCTRootShadowView *shadowView = [RCTRootShadowView new ];
299
299
shadowView.availableSize = availableSize;
300
300
shadowView.reactTag = reactTag;
301
- shadowView.backgroundColor = rootView.backgroundColor ;
302
301
shadowView.viewName = NSStringFromClass ([rootView class ]);
303
302
self->_shadowViewRegistry [shadowView.reactTag] = shadowView;
304
303
[self ->_rootViewTags addObject: reactTag];
@@ -417,20 +416,6 @@ - (void)setIntrinsicContentSize:(CGSize)intrinsicContentSize forView:(UIView *)v
417
416
} forTag: view.reactTag];
418
417
}
419
418
420
- - (void )setBackgroundColor : (UIColor *)color forView : (UIView *)view
421
- {
422
- RCTAssertMainQueue ();
423
- [self _executeBlockWithShadowView: ^(RCTShadowView *shadowView) {
424
- if (!self->_viewRegistry ) {
425
- return ;
426
- }
427
-
428
- shadowView.backgroundColor = color;
429
- [self _amendPendingUIBlocksWithStylePropagationUpdateForShadowView: shadowView];
430
- [self flushUIBlocksWithCompletion: ^{}];
431
- } forTag: view.reactTag];
432
- }
433
-
434
419
/* *
435
420
* Unregisters views from registries
436
421
*/
@@ -969,11 +954,6 @@ - (void)_manageChildren:(NSNumber *)containerTag
969
954
shadowView.rootView = (RCTRootShadowView *)rootView;
970
955
}
971
956
972
- // Shadow view is the source of truth for background color this is a little
973
- // bit counter-intuitive if people try to set background color when setting up
974
- // the view, but it's the only way that makes sense given our threading model
975
- UIColor *backgroundColor = shadowView.backgroundColor ;
976
-
977
957
// Dispatch view creation directly to the main thread instead of adding to
978
958
// UIBlocks array. This way, it doesn't get deferred until after layout.
979
959
__weak RCTUIManager *weakManager = self;
@@ -984,11 +964,7 @@ - (void)_manageChildren:(NSNumber *)containerTag
984
964
}
985
965
UIView *view = [componentData createViewWithTag: reactTag];
986
966
if (view) {
987
- [componentData setProps: props forView: view]; // Must be done before bgColor to prevent wrong default
988
- if ([view respondsToSelector: @selector (setBackgroundColor: )]) {
989
- ((UIView *)view).backgroundColor = backgroundColor;
990
- }
991
-
967
+ [componentData setProps: props forView: view];
992
968
uiManager->_viewRegistry [reactTag] = view;
993
969
994
970
#if RCT_DEV
0 commit comments