Skip to content

Commit 2269f4a

Browse files
committed
Update TextShadowNode.h
1 parent 0a73866 commit 2269f4a

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

  • packages/react-native/ReactCommon/react/renderer/components/text

packages/react-native/ReactCommon/react/renderer/components/text/TextShadowNode.h

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,21 @@ class TextShadowNode : public ConcreteShadowNode<TextComponentName, ShadowNode,
4242
{
4343
orderIndex_ = std::numeric_limits<decltype(orderIndex_)>::max();
4444
}
45+
#else
4546
using BaseShadowNode = ConcreteShadowNode<TextComponentName, ShadowNode, TextProps, TextEventEmitter>;
4647

47-
static ShadowNodeTraits getModifiedTraitsForText(const ShadowNodeFragment &fragment, ShadowNodeTraits traits)
48-
{
49-
auto textProps = std::static_pointer_cast<const TextProps>(fragment.props);
50-
if (textProps && !textProps->transform.operations.empty()) {
51-
traits.set(ShadowNodeTraits::Trait::FormsView);
52-
}
53-
return traits;
54-
}
55-
5648
TextShadowNode(const ShadowNodeFragment &fragment, const ShadowNodeFamily::Shared &family, ShadowNodeTraits traits)
57-
: BaseShadowNode(fragment, family, getModifiedTraitsForText(fragment, traits)), BaseTextShadowNode()
49+
: BaseShadowNode(
50+
fragment,
51+
family,
52+
[&] {
53+
auto textProps = std::static_pointer_cast<const TextProps>(fragment.props);
54+
if (textProps && !textProps->transform.operations.empty()) {
55+
traits.set(ShadowNodeTraits::Trait::FormsView);
56+
}
57+
return traits;
58+
}()),
59+
BaseTextShadowNode()
5860
{
5961
}
6062
#endif

0 commit comments

Comments
 (0)