Skip to content

Commit 2a46980

Browse files
JoshuaGrossfacebook-github-bot
authored andcommitted
AttributedString equality: only check tags of parentShadowView; ShadowViews are never equal otherwise
Summary: For future diffs, we need to check AttributedStrings for equality. It turns out that any time props or state change, two `parentShadowView`s will never be equal to each other, even if we'd consider them equal for our use-cases here for AttributedStrings. Just compare the tags instead of the whole object. NOTE: I don't have any strong opinions about how we should be comparing them. It just isn't working currently for AndroidTextInput. Comparing tags seems convenient and reasonably correct for now. Changelog: [Internal] Reviewed By: shergin Differential Revision: D18786004 fbshipit-source-id: 13c0e881cd8d2c2a207e8891309b3c9b880b827f
1 parent 25ce622 commit 2a46980

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ReactCommon/fabric/attributedstring/AttributedString.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ bool Fragment::isAttachment() const {
2626
}
2727

2828
bool Fragment::operator==(const Fragment &rhs) const {
29-
return std::tie(string, textAttributes, parentShadowView) ==
30-
std::tie(rhs.string, rhs.textAttributes, rhs.parentShadowView);
29+
return std::tie(string, textAttributes, parentShadowView.tag) ==
30+
std::tie(rhs.string, rhs.textAttributes, rhs.parentShadowView.tag);
3131
}
3232

3333
bool Fragment::operator!=(const Fragment &rhs) const {

0 commit comments

Comments
 (0)