Add missing ScrollView props to ScrollProps (#51167)

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

Adding the ScrollView properties that are android specific to the common ScrollView props so that they can be diffed in a getDiffProps implementation.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D74327335

fbshipit-source-id: 8e5683d4bf7fe0f6d54d4b97f535731721c60292
This commit is contained in:
Nick Lefever
2025-05-08 09:37:26 -07:00
committed by Facebook GitHub Bot
parent 68baff1d67
commit 4591bb2909
2 changed files with 35 additions and 2 deletions
@@ -371,7 +371,27 @@ ScrollViewProps::ScrollViewProps(
rawProps,
"isInvertedVirtualizedList",
sourceProps.isInvertedVirtualizedList,
{})) {}
{})),
sendMomentumEvents(
ReactNativeFeatureFlags::enableCppPropsIteratorSetter()
? sourceProps.sendMomentumEvents
: convertRawProp(
context,
rawProps,
"sendMomentumEvents",
sourceProps.sendMomentumEvents,
true)),
nestedScrollEnabled(
ReactNativeFeatureFlags::enableCppPropsIteratorSetter()
? sourceProps.nestedScrollEnabled
: convertRawProp(
context,
rawProps,
"nestedScrollEnabled",
sourceProps.nestedScrollEnabled,
true))
{}
void ScrollViewProps::setProp(
const PropsParserContext& context,
@@ -424,6 +444,8 @@ void ScrollViewProps::setProp(
RAW_SET_PROP_SWITCH_CASE_BASIC(contentInsetAdjustmentBehavior);
RAW_SET_PROP_SWITCH_CASE_BASIC(scrollToOverflowEnabled);
RAW_SET_PROP_SWITCH_CASE_BASIC(isInvertedVirtualizedList);
RAW_SET_PROP_SWITCH_CASE_BASIC(sendMomentumEvents);
RAW_SET_PROP_SWITCH_CASE_BASIC(nestedScrollEnabled);
}
}
@@ -558,7 +580,15 @@ SharedDebugStringConvertibleList ScrollViewProps::getDebugProps() const {
debugStringConvertibleItem(
"isInvertedVirtualizedList",
snapToEnd,
defaultScrollViewProps.isInvertedVirtualizedList)};
defaultScrollViewProps.isInvertedVirtualizedList),
debugStringConvertibleItem(
"sendMomentumEvents",
sendMomentumEvents,
defaultScrollViewProps.sendMomentumEvents),
debugStringConvertibleItem(
"nestedScrollEnabled",
nestedScrollEnabled,
defaultScrollViewProps.nestedScrollEnabled)};
}
#endif
@@ -74,6 +74,9 @@ class ScrollViewProps final : public ViewProps {
bool scrollToOverflowEnabled{false};
bool isInvertedVirtualizedList{false};
bool sendMomentumEvents{};
bool nestedScrollEnabled{};
#pragma mark - DebugStringConvertible
#if RN_DEBUG_STRING_CONVERTIBLE