Skip to content

Commit

Permalink
Removed support of nested content inside <Image> on iOS
Browse files Browse the repository at this point in the history
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
  • Loading branch information
shergin authored and facebook-github-bot committed Sep 11, 2017
1 parent 73c3aa8 commit c55fae1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Libraries/Image/RCTImageShadowView.m
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit c55fae1

Please sign in to comment.