diff --git a/packages/react-native/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp b/packages/react-native/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp index 1aa2de1d98e..3bfa3a97f23 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp +++ b/packages/react-native/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp @@ -106,14 +106,20 @@ YogaLayoutableShadowNode::YogaLayoutableShadowNode( yogaConfig_(FabricDefaultYogaLog), yogaNode_(static_cast(sourceShadowNode) .yogaNode_) { - // Note, cloned `yoga::Node` instance (copied using copy-constructor) inherits - // dirty flag, measure function, and other properties being set originally in - // the `YogaLayoutableShadowNode` constructor above. +// Note, cloned `yoga::Node` instance (copied using copy-constructor) inherits +// dirty flag, measure function, and other properties being set originally in +// the `YogaLayoutableShadowNode` constructor above. +// There is a known race condition when background executor is enabled, where +// a tree may be laid out on the Fabric background thread concurrently with +// the ShadowTree being created on the JS thread. This assert can be +// re-enabled after disabling background executor everywhere. +#if 0 react_native_assert( static_cast(sourceShadowNode) .yogaNode_.isDirty() == yogaNode_.isDirty() && "Yoga node must inherit dirty flag."); +#endif if (!getTraits().check(ShadowNodeTraits::Trait::LeafYogaNode)) { for (auto& child : getChildren()) {