mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
committed by
Facebook GitHub Bot
parent
07c64ba341
commit
c301a25251
+13
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user