Fixed clowntoun related to `-[RCTShadowView canHaveSubviews]`

Summary:
Shame on me.
Naming can be hard. We have to use positive logic to avoid this kind of bugs. :(

In the bright future we also have to rename `isYogaLeafNode` to something with positive logic, like `canHaveYogaChildNodes`.
But before we can do this, we have to have solid plan how to unify it with Android.

Reviewed By: mmmulani

Differential Revision: D5780917

fbshipit-source-id: 1ddaaea06f5618b91528cc87f1433a55b5fae4ac
This commit is contained in:
Valentin Shergin 2017-09-06 23:40:19 -07:00 коммит произвёл Facebook Github Bot
Родитель d2f3a7282b
Коммит 7b962397b6
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -374,7 +374,7 @@ static void RCTProcessMetaPropsBorder(const YGValue metaProps[META_PROP_COUNT],
- (BOOL)canHaveSubviews
{
return NO;
return YES;
}
- (BOOL)isYogaLeafNode
@ -415,7 +415,7 @@ static void RCTProcessMetaPropsBorder(const YGValue metaProps[META_PROP_COUNT],
- (void)insertReactSubview:(RCTShadowView *)subview atIndex:(NSInteger)atIndex
{
RCTAssert(!self.canHaveSubviews, @"Attempt to insert subview inside leaf view.");
RCTAssert(self.canHaveSubviews, @"Attempt to insert subview inside leaf view.");
[_reactSubviews insertObject:subview atIndex:atIndex];
if (![self isYogaLeafNode]) {