@react-native/virtualized-lists 0.87.0-nightly-20260608-2ff3b81dc → 0.87.0-nightly-20260618-e1b0c7750

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -535,16 +535,18 @@ class VirtualizedList extends StateSafePureComponent<
535
535
  renderMask.addCells(initialRegion);
536
536
  }
537
537
 
538
- // The layout coordinates of sticker headers may be off-screen while the
538
+ // The layout coordinates of sticky headers may be off-screen while the
539
539
  // actual header is on-screen. Keep the most recent before the viewport
540
540
  // rendered, even if its layout coordinates are not in viewport.
541
- const stickyIndicesSet = new Set(props.stickyHeaderIndices);
542
- VirtualizedList._ensureClosestStickyHeader(
543
- props,
544
- stickyIndicesSet,
545
- renderMask,
546
- cellsAroundViewport.first,
547
- );
541
+ const stickyHeaderIndices = props.stickyHeaderIndices;
542
+ if (stickyHeaderIndices != null && stickyHeaderIndices.length > 0) {
543
+ VirtualizedList._ensureClosestStickyHeader(
544
+ props,
545
+ stickyHeaderIndices,
546
+ renderMask,
547
+ cellsAroundViewport.first,
548
+ );
549
+ }
548
550
  }
549
551
 
550
552
  return renderMask;
@@ -575,18 +577,30 @@ class VirtualizedList extends StateSafePureComponent<
575
577
 
576
578
  static _ensureClosestStickyHeader(
577
579
  props: VirtualizedListProps,
578
- stickyIndicesSet: Set<number>,
580
+ stickyHeaderIndices: ReadonlyArray<number>,
579
581
  renderMask: CellRenderMask,
580
582
  cellIdx: number,
581
583
  ) {
582
584
  const stickyOffset = props.ListHeaderComponent ? 1 : 0;
585
+ const targetStickyIndex = cellIdx + stickyOffset;
586
+ let closestStickyIndex = null;
583
587
 
584
- for (let itemIdx = cellIdx - 1; itemIdx >= 0; itemIdx--) {
585
- if (stickyIndicesSet.has(itemIdx + stickyOffset)) {
586
- renderMask.addCells({first: itemIdx, last: itemIdx});
587
- break;
588
+ for (let itemIdx = 0; itemIdx < stickyHeaderIndices.length; itemIdx++) {
589
+ const stickyIndex = stickyHeaderIndices[itemIdx];
590
+ if (
591
+ Number.isInteger(stickyIndex) &&
592
+ stickyIndex < targetStickyIndex &&
593
+ stickyIndex >= stickyOffset &&
594
+ (closestStickyIndex == null || stickyIndex > closestStickyIndex)
595
+ ) {
596
+ closestStickyIndex = stickyIndex;
588
597
  }
589
598
  }
599
+
600
+ if (closestStickyIndex != null) {
601
+ const itemIdx = closestStickyIndex - stickyOffset;
602
+ renderMask.addCells({first: itemIdx, last: itemIdx});
603
+ }
590
604
  }
591
605
 
592
606
  _adjustCellsAroundViewport(
package/README.md CHANGED
@@ -1,21 +1,10 @@
1
1
  # @react-native/virtualized-lists
2
2
 
3
- [![Version][version-badge]][package]
3
+ [![npm]](https://www.npmjs.com/package/@react-native/virtualized-lists) [![npm downloads]](https://www.npmjs.com/package/@react-native/virtualized-lists)
4
4
 
5
- ## Installation
5
+ [npm]: https://img.shields.io/npm/v/@react-native/virtualized-lists.svg?color=blue
6
+ [npm downloads]: https://img.shields.io/npm/dm/@react-native/virtualized-lists.svg
6
7
 
7
- ```
8
- yarn add @react-native/virtualized-lists
9
- ```
8
+ > This is an internal dependency of React Native. **Please don't depend on it directly.**
10
9
 
11
- *Note: We're using `yarn` to install deps. Feel free to change commands to use `npm` 3+ and `npx` if you like*
12
-
13
- [version-badge]: https://img.shields.io/npm/v/@react-native/virtualized-lists?style=flat-square
14
- [package]: https://www.npmjs.com/package/@react-native/virtualized-lists
15
-
16
- ## Testing
17
-
18
- To run the tests in this package, run the following commands from the React Native root folder:
19
-
20
- 1. `yarn` to install the dependencies. You just need to run this once
21
- 2. `yarn jest packages/virtualized-lists`.
10
+ Virtualized list primitives (`VirtualizedList`, `VirtualizedSectionList`) backing React Native's `FlatList` and `SectionList` components.
package/package.json CHANGED
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "@react-native/virtualized-lists",
3
- "version": "0.87.0-nightly-20260608-2ff3b81dc",
3
+ "version": "0.87.0-nightly-20260618-e1b0c7750",
4
4
  "description": "Virtualized lists for React Native.",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "git+https://github.com/facebook/react-native.git",
8
+ "url": "git+https://github.com/react/react-native.git",
9
9
  "directory": "packages/virtualized-lists"
10
10
  },
11
- "homepage": "https://github.com/facebook/react-native/tree/HEAD/packages/virtualized-lists#readme",
11
+ "homepage": "https://github.com/react/react-native/tree/HEAD/packages/virtualized-lists#readme",
12
12
  "keywords": [
13
13
  "lists",
14
14
  "virtualized-lists",
15
15
  "section-lists",
16
16
  "react-native"
17
17
  ],
18
- "bugs": "https://github.com/facebook/react-native/issues",
18
+ "bugs": "https://github.com/react/react-native/issues",
19
19
  "engines": {
20
20
  "node": "^22.13.0 || ^24.3.0 || >= 26.0.0"
21
21
  },
@@ -53,7 +53,7 @@
53
53
  "peerDependencies": {
54
54
  "@types/react": "^19.2.0",
55
55
  "react": "*",
56
- "react-native": "0.87.0-nightly-20260608-2ff3b81dc"
56
+ "react-native": "0.87.0-nightly-20260618-e1b0c7750"
57
57
  },
58
58
  "peerDependenciesMeta": {
59
59
  "@types/react": {