diff --git a/patches/react-native@0.81.5.patch b/patches/react-native@0.81.5.patch index 4a04d61383..d7e0d10328 100644 --- a/patches/react-native@0.81.5.patch +++ b/patches/react-native@0.81.5.patch @@ -11,6 +11,29 @@ index 914a2494a57923fbf185644b7e2bb8aca8848e56..0deac55f22350f5e8377d8963fb1c243 @end NS_ASSUME_NONNULL_END +diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm +index 0d231bc8aa938da296eb3b981e8ac9595a43b87f..be0a10d9c4de1892fa00bcbf8d63d739b66d8ffe 100644 +--- a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm ++++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm +@@ -76,7 +76,17 @@ - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared & + return; + } + +- const auto &oldConcreteProps = static_cast(*_props); ++ /* ++ * TODO: Remove after upgrading React Native to 0.82+ (fixed upstream by ++ * facebook/react-native#52615, #52584 and #53231). ++ * Diff against oldProps instead of _props. During the initial-layout replay ++ * from layoutSubviews, _props already holds the new props, so diffing ++ * against it is a no-op and tintColor/progressViewOffset are never applied ++ * on mount (facebook/react-native#56343). oldProps is null-guarded because ++ * the create-mutation path passes nullptr. ++ */ ++ const auto &oldConcreteProps = static_cast( ++ oldProps ? *oldProps : *PullToRefreshViewShadowNode::defaultSharedProps()); + const auto &newConcreteProps = static_cast(*props); + + if (newConcreteProps.tintColor != oldConcreteProps.tintColor) { diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm index 1494fd225aff1fa0429e917404d6b4ca5fc961c5..df643f5c844ad2e684de5161528eba17f4a188d0 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm diff --git a/patches/react-native@0.81.5.patch.md b/patches/react-native@0.81.5.patch.md index 7b44346c23..adf2e4912d 100644 --- a/patches/react-native@0.81.5.patch.md +++ b/patches/react-native@0.81.5.patch.md @@ -12,6 +12,19 @@ Patching `RCTRefreshControl.m` and `RCTRefreshControl.h` to add a new `forwarder This method is used by `ExpoScrollForwarder` to initiate a refresh of the underlying `UIScrollView` from inside that module. +## RCTPullToRefreshViewComponentView.mm Patch - RefreshControl initial props dropped on New Arch + +**TODO: Remove after bumping React Native to 0.82+** (fixed upstream by facebook/react-native#52615, #52584 +and #53231). + +On Fabric, `updateProps` diffs against `_props`, but the initial-layout replay in `layoutSubviews` passes +`_props` as the new props too, so the diff is a no-op and `tintColor`/`progressViewOffset`/`title` are never +applied on mount. This hides the pull-to-refresh spinner behind the floating home header (it stays at offset +0 instead of `headerOffset`). We diff against the `oldProps` argument instead, null-guarded with default +props for the create-mutation path. + +Issue: https://github.com/facebook/react-native/issues/56343 + ## RCTTextLayoutManager.mm Patch - Text overflows instead of wrapping on the last line Issue: https://github.com/react/react-native/issues/53450#issuecomment-3298157830