Skip to content

Commit 4175096

Browse files
Nick Lefeverfacebook-github-bot
authored andcommitted
Remove equivalent NaN float values from diff output (facebook#54462)
Summary: With `opacity` being initialized to NaN for text attributes, not having the NaN check would mean adding the `opacity` prop to the Props 2.0 diff output even when it was unchanged and still set to NaN Changelog: [Internal] Differential Revision: D86577389
1 parent e798772 commit 4175096

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/react-native/ReactCommon/react/renderer/components/text/BaseTextProps.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,8 @@ void BaseTextProps::appendTextAttributesProps(
524524
: nullptr;
525525
}
526526

527-
if (textAttributes.opacity != oldProps->textAttributes.opacity) {
527+
if (!floatEquality(
528+
textAttributes.opacity, oldProps->textAttributes.opacity)) {
528529
result["opacity"] = textAttributes.opacity;
529530
}
530531

0 commit comments

Comments
 (0)