Removed support of nested content inside <Image> on iOS

Summary:
Use <ImageBackground> instead or (even better), implement it yourself using container <View> and nested <Image> with `position: absolute;` styling.

This diff was decoupled from D5189017 for more granularity.

Reviewed By: mmmulani

Differential Revision: D5779989

fbshipit-source-id: e0a724008e679426f61ed0841f9eff6d62fb943b
This commit is contained in:
Valentin Shergin 2017-09-10 21:37:47 -07:00 committed by Facebook Github Bot
parent 73c3aa8d32
commit c55fae1e26
1 changed files with 6 additions and 5 deletions

View File

@ -13,13 +13,14 @@
@implementation RCTImageShadowView
- (void)insertReactSubview:(RCTShadowView *)subview atIndex:(NSInteger)atIndex
- (BOOL)isYogaLeafNode
{
RCTLogWarn(@"Using <Image> with children is deprecated "
"and will be an error in the near future. "
"Please reconsider the layout or use <ImageBackground> instead.");
return YES;
}
[super insertReactSubview:subview atIndex:atIndex];
- (BOOL)canHaveSubviews
{
return NO;
}
@end