mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fabric: Using ShadowNodeTraits::Trait::MeasurableYogaNode in TextInput
Summary: It is the correct way to deal with the measure function. I believe it can fix the crash we see with TextInput state update. The crash is probably caused by invalid value of `shadowNodeRawPtr` in `YogaLayoutableShadowNode::yogaNodeCloneCallbackConnector`. It's hard to reconstruct the full chain of events but I think it's related: Yoga's dirty flag influences cloning, so the improper setting of this flag can misalign "natural" ShadowNode cloning (influenced by changes in the tree) and YGNode-initiated cloning (triggered by layout process). Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D25937710 fbshipit-source-id: a4e7c9dd8f5e6598fc662f4c6ee8061fd795e20d
This commit is contained in:
committed by
Facebook GitHub Bot
parent
8684ef499f
commit
3d166a0a4c
-2
@@ -34,8 +34,6 @@ class TextInputComponentDescriptor final
|
||||
std::static_pointer_cast<TextInputShadowNode>(shadowNode);
|
||||
|
||||
concreteShadowNode->setTextLayoutManager(textLayoutManager_);
|
||||
concreteShadowNode->dirtyLayout();
|
||||
concreteShadowNode->enableMeasurement();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -37,6 +37,7 @@ class TextInputShadowNode : public ConcreteViewShadowNode<
|
||||
auto traits = ConcreteViewShadowNode::BaseTraits();
|
||||
traits.set(ShadowNodeTraits::Trait::TextKind);
|
||||
traits.set(ShadowNodeTraits::Trait::LeafYogaNode);
|
||||
traits.set(ShadowNodeTraits::Trait::MeasurableYogaNode);
|
||||
return traits;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user