Permalink
Browse files

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
  • Loading branch information...
shergin authored and facebook-github-bot committed Sep 11, 2017
1 parent 73c3aa8 commit c55fae1e2697520a55d23a0816552bec09920142
Showing with 6 additions and 5 deletions.
  1. +6 −5 Libraries/Image/RCTImageShadowView.m
@@ -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

2 comments on commit c55fae1

@ssssssssssss

This comment has been minimized.

Show comment
Hide comment
@ssssssssssss

ssssssssssss Sep 11, 2017

Breaking Change. No?

ssssssssssss replied Sep 11, 2017

Breaking Change. No?

@shergin

This comment has been minimized.

Show comment
Hide comment
@shergin

shergin Sep 11, 2017

Contributor

Yes, it is.
Sorry, I had to add this to title. 😞

Contributor

shergin replied Sep 11, 2017

Yes, it is.
Sorry, I had to add this to title. 😞

Please sign in to comment.