Add hitSlop prop diffing to View component (#51329)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51329

See title

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D74741639

fbshipit-source-id: da7317c8800d2f25c69ecd7d3aca9b75350c2a56
This commit is contained in:
Nick Lefever
2025-05-14 15:43:33 -07:00
committed by Facebook GitHub Bot
parent 07c64ba341
commit c301a25251
@@ -527,6 +527,15 @@ static folly::dynamic toDynamic(const std::vector<FilterFunction>& filter) {
return filterResult;
}
static folly::dynamic toDynamic(const EdgeInsets& edgeInsets) {
folly::dynamic edgeInsetsResult = folly::dynamic::object();
edgeInsetsResult["left"] = edgeInsets.left;
edgeInsetsResult["top"] = edgeInsets.top;
edgeInsetsResult["right"] = edgeInsets.right;
edgeInsetsResult["bottom"] = edgeInsets.bottom;
return edgeInsetsResult;
}
folly::dynamic HostPlatformViewProps::getDiffProps(
const Props* prevProps) const {
folly::dynamic result = folly::dynamic::object();
@@ -659,6 +668,10 @@ folly::dynamic HostPlatformViewProps::getDiffProps(
}
}
if (hitSlop != oldProps->hitSlop) {
result["hitSlop"] = toDynamic(hitSlop);
}
if (nativeId != oldProps->nativeId) {
result["nativeID"] = nativeId;
}