Skip to content

Commit 2508c46

Browse files
sherginfacebook-github-bot
authored andcommitted
Fabric: More asserts in YogaLayoutableShadowNode
Summary: These `assert`s must be satisfied. Having them allows us to fail early in case of bugs. I spent a log of time debugging an issue and finally found that after adding those `assert`s. Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D20268046 fbshipit-source-id: 1d8ddd6de00069bd2a79e74af5e4278aa6c9131b
1 parent b5aaa25 commit 2508c46

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,11 +261,15 @@ void YogaLayoutableShadowNode::layoutTree(
261261
}
262262

263263
void YogaLayoutableShadowNode::layoutChildren(LayoutContext layoutContext) {
264+
assert(!yogaNode_.isDirty());
265+
264266
for (const auto &childYogaNode : yogaNode_.getChildren()) {
265267
if (!childYogaNode->getHasNewLayout()) {
266268
continue;
267269
}
268270

271+
assert(!childYogaNode->isDirty());
272+
269273
auto childNode =
270274
static_cast<YogaLayoutableShadowNode *>(childYogaNode->getContext());
271275

0 commit comments

Comments
 (0)