mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fabric: Added assert in ShadowNode
Summary: It's not allowed to return nullptr from the callback. The assert ensures it which is helpful during development. Probably, we should consider using `gsl::not_null<>` here. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D21149891 fbshipit-source-id: a5f77b35029f22b499491721036405682f812a38
This commit is contained in:
committed by
Facebook GitHub Bot
parent
81734276b9
commit
fef8bc33df
@@ -263,6 +263,10 @@ ShadowNode::Unshared ShadowNode::cloneTree(
|
||||
|
||||
auto newShadowNode = callback(*oldShadowNode);
|
||||
|
||||
assert(
|
||||
newShadowNode &&
|
||||
"`callback` returned `nullptr` which is not allowed value.");
|
||||
|
||||
auto childNode = newShadowNode;
|
||||
|
||||
for (auto it = ancestors.rbegin(); it != ancestors.rend(); ++it) {
|
||||
|
||||
Reference in New Issue
Block a user