Skip to content

Commit 5326d83

Browse files
[repro] View Props 2.0 payload: removing shadowColor sends 0
1 parent f374898 commit 5326d83

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎packages/react-native/ReactCommon/react/renderer/components/view/tests/ViewPropsDiffTest.cpp‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ void expectPayloads(const std::vector<PropsCommit>& commits) {
2222
expectPayloadsMatchRawProps<ViewProps>(commits);
2323
}
2424

25+
const auto kRed = static_cast<int32_t>(0xFFFF0000);
2526

2627
} // namespace
2728

@@ -75,6 +76,15 @@ TEST(ViewPropsDiffTest, dropShadowWithoutColorOmitsColor) {
7576
"standardDeviation", 4))))}});
7677
}
7778

79+
// BaseViewManager.setShadowColor resets to black for null; 0 makes the
80+
// elevation shadow transparent.
81+
TEST(ViewPropsDiffTest, removingShadowColorEmitsNull) {
82+
expectPayloads({
83+
{dynamic::object("elevation", 8)("shadowColor", kRed)},
84+
{dynamic::object("shadowColor", nullptr)},
85+
});
86+
}
87+
7888
} // namespace facebook::react
7989

8090
#endif

0 commit comments

Comments
 (0)