mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Make new nodes dirty by default (#44010)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/44010 X-link: https://github.com/facebook/yoga/pull/1641 Yoga has quirk where newly constructed nodes are clean, which isn't really correct. Normally never shows in in real code because setting a style or children will dirty. Fabric doesn't use the public APIs that do this dirtying, so it ends up getting creative instead. We should fix so that newly constructed nodes are dirty. Copy-constructed Nodes (also only a Fabric thing, will retain original dirty flag. Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D55855328 fbshipit-source-id: be49efaf8ac29351f8e5ec509bd9912546944332
This commit is contained in:
committed by
Facebook GitHub Bot
parent
3098613f6e
commit
44d59ea6f9
-4
@@ -72,10 +72,6 @@ YogaLayoutableShadowNode::YogaLayoutableShadowNode(
|
||||
yogaNode_(&initializeYogaConfig(yogaConfig_)) {
|
||||
yogaNode_.setContext(this);
|
||||
|
||||
// Newly created node must be `dirty` just because it is new.
|
||||
// This is not a default for `yoga::Node`.
|
||||
yogaNode_.setDirty(true);
|
||||
|
||||
if (getTraits().check(ShadowNodeTraits::Trait::MeasurableYogaNode)) {
|
||||
react_native_assert(
|
||||
getTraits().check(ShadowNodeTraits::Trait::LeafYogaNode));
|
||||
|
||||
@@ -271,7 +271,7 @@ class YG_EXPORT Node : public ::YGNode {
|
||||
|
||||
bool hasNewLayout_ : 1 = true;
|
||||
bool isReferenceBaseline_ : 1 = false;
|
||||
bool isDirty_ : 1 = false;
|
||||
bool isDirty_ : 1 = true;
|
||||
bool alwaysFormsContainingBlock_ : 1 = false;
|
||||
NodeType nodeType_ : bitCount<NodeType>() = NodeType::Default;
|
||||
void* context_ = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user