Skip to content

Commit f22a391

Browse files
committed
Update patch to v2.3.0 with recent version bump
1 parent 7cbdbec commit f22a391

3 files changed

Lines changed: 27 additions & 60 deletions

File tree

patches/@shopify/flash-list/@shopify+flash-list+2.2.0+002+skip-layout-when-hidden.patch

Lines changed: 0 additions & 59 deletions
This file was deleted.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
diff --git a/node_modules/@shopify/flash-list/dist/recyclerview/RecyclerView.js b/node_modules/@shopify/flash-list/dist/recyclerview/RecyclerView.js
2+
index 8b75322..dd2d3bc 100644
3+
--- a/node_modules/@shopify/flash-list/dist/recyclerview/RecyclerView.js
4+
+++ b/node_modules/@shopify/flash-list/dist/recyclerview/RecyclerView.js
5+
@@ -74,6 +74,10 @@ const RecyclerViewComponent = (props, ref) => {
6+
if (internalViewRef.current && firstChildViewRef.current) {
7+
// Measure the outer container size and inner container layout
8+
const outerViewSize = measureParentSize(internalViewRef.current);
9+
+ if (outerViewSize.width === 0 && outerViewSize.height === 0) {
10+
+ containerViewSizeRef.current = outerViewSize;
11+
+ return;
12+
+ }
13+
const firstChildViewLayout = measureFirstChildLayout(firstChildViewRef.current, internalViewRef.current);
14+
containerViewSizeRef.current = outerViewSize;
15+
// firstChildViewLayout is already relative to the outer container,
16+
@@ -103,6 +107,10 @@ const RecyclerViewComponent = (props, ref) => {
17+
if (pendingChildIds.size > 0) {
18+
return;
19+
}
20+
+ if (((_a = containerViewSizeRef.current) === null || _a === void 0 ? void 0 : _a.width) === 0 &&
21+
+ ((_b = containerViewSizeRef.current) === null || _b === void 0 ? void 0 : _b.height) === 0) {
22+
+ return;
23+
+ }
24+
const layoutInfo = Array.from(refHolder, ([index, viewHolderRef]) => {
25+
const layout = measureItemLayout(viewHolderRef.current, recyclerViewManager.tryGetLayout(index));
26+
// comapre height with stored layout

patches/@shopify/flash-list/details.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
- E/App issue: https://github.com/Expensify/App/issues/33725
1111
- PR introducing patch: https://github.com/Expensify/App/pull/81566
1212

13-
### [@shopify+flash-list+2.2.0+002+skip-layout-when-hidden.patch](@shopify+flash-list+2.2.0+002+skip-layout-when-hidden.patch)
13+
### [@shopify+flash-list+2.3.0+002+skip-layout-when-hidden.patch](@shopify+flash-list+2.3.0+002+skip-layout-when-hidden.patch)
1414

1515
- Reason: Prevents FlashList from losing its render state when a navigation stack hides the parent container with `display: none`. Two early-return guards added in `RecyclerView`:
1616
1. **First `useLayoutEffect`** (measures parent container): After calling `measureParentSize()`, if both width and height are 0, return early before calling `updateLayoutParams()` or updating `containerViewSizeRef`. This preserves the last known valid window size and prevents the layout manager from receiving zero dimensions.

0 commit comments

Comments
 (0)