Assertion on attempt to get layout metrics from dirtied Yoga node

Reviewed By: javache

Differential Revision: D4865294

fbshipit-source-id: e1bd2f297af87ffa817003f9e4dae94ad2c96644
This commit is contained in:
Valentin Shergin 2017-05-01 12:03:11 -07:00 committed by Facebook Github Bot
parent cf5c549633
commit 18fd18e792
1 changed files with 2 additions and 0 deletions

View File

@ -167,6 +167,8 @@ static void RCTProcessMetaPropsBorder(const YGValue metaProps[META_PROP_COUNT],
} }
YGNodeSetHasNewLayout(node, false); YGNodeSetHasNewLayout(node, false);
RCTAssert(!YGNodeIsDirty(node), @"Attempt to get layout metrics from dirtied Yoga node.");
#if RCT_DEBUG #if RCT_DEBUG
// This works around a breaking change in Yoga layout where setting flexBasis needs to be set explicitly, instead of relying on flex to propagate. // This works around a breaking change in Yoga layout where setting flexBasis needs to be set explicitly, instead of relying on flex to propagate.
// We check for it by seeing if a width/height is provided along with a flexBasis of 0 and the width/height is laid out as 0. // We check for it by seeing if a width/height is provided along with a flexBasis of 0 and the width/height is laid out as 0.