Skip to content

Commit

Permalink
Fabric: Using ShadowNodeTraits::Trait::MeasurableYogaNode in Paragr…
Browse files Browse the repository at this point in the history
…aphShadowNode

Summary:
Similarly to D25937710 (3d166a0) we are moving away from using imperative methods that dirty Yoga node.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D26069354

fbshipit-source-id: 3d4e1bd4715a204d90174c7ea29b56438778bfa3
  • Loading branch information
shergin authored and facebook-github-bot committed Feb 1, 2021
1 parent 67699ba commit d6341c4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,6 @@ class ParagraphComponentDescriptor final
// `ParagraphShadowNode` uses `TextLayoutManager` to measure text content
// and communicate text rendering metrics to mounting layer.
paragraphShadowNode->setTextLayoutManager(textLayoutManager_);

paragraphShadowNode->dirtyLayout();

// All `ParagraphShadowNode`s must have leaf Yoga nodes with properly
// setup measure function.
paragraphShadowNode->enableMeasurement();
}

private:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class ParagraphShadowNode : public ConcreteViewShadowNode<
auto traits = ConcreteViewShadowNode::BaseTraits();
traits.set(ShadowNodeTraits::Trait::LeafYogaNode);
traits.set(ShadowNodeTraits::Trait::TextKind);
traits.set(ShadowNodeTraits::Trait::MeasurableYogaNode);

#ifdef ANDROID
// Unsetting `FormsStackingContext` trait is essential on Android where we
Expand Down

0 comments on commit d6341c4

Please sign in to comment.