mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fabric: Introducing BaseTextShadowNode::getAttributedString()
Summary: `BaseTextShadowNode::getAttributedString()` was replaced with simular method `BaseTextShadowNode::buildAttributedString()` which does same work with following differences: * Besides returning `AttributedString`, it retures an array of `Attachment`s elements of which points to `ShadowNode`s that form attachments; * Now we use single `AttributedString` to construct result instead of concatenation objects recurvily walking the tree. We will use the array of attachments later. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D20268048 fbshipit-source-id: 371c548826bdfd5c4f4b18915d68977724885ce6
This commit is contained in:
committed by
Facebook Github Bot
parent
dedf9372ca
commit
f18358dda6
+5
-2
@@ -33,8 +33,11 @@ AttributedString AndroidTextInputShadowNode::getAttributedString() const {
|
||||
// Use BaseTextShadowNode to get attributed string from children
|
||||
auto childTextAttributes = TextAttributes::defaultTextAttributes();
|
||||
childTextAttributes.apply(getConcreteProps().textAttributes);
|
||||
auto attributedString =
|
||||
BaseTextShadowNode::getAttributedString(childTextAttributes, *this);
|
||||
|
||||
auto attributedString = AttributedString{};
|
||||
auto attachments = BaseTextShadowNode::Attachments{};
|
||||
BaseTextShadowNode::buildAttributedString(
|
||||
childTextAttributes, *this, attributedString, attachments);
|
||||
|
||||
// BaseTextShadowNode only gets children. We must detect and prepend text
|
||||
// value attributes manually.
|
||||
|
||||
Reference in New Issue
Block a user