@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.
- package/Lists/VirtualizedList.js +27 -13
- package/README.md +5 -16
- package/package.json +5 -5
package/Lists/VirtualizedList.js
CHANGED
|
@@ -535,16 +535,18 @@ class VirtualizedList extends StateSafePureComponent<
|
|
|
535
535
|
renderMask.addCells(initialRegion);
|
|
536
536
|
}
|
|
537
537
|
|
|
538
|
-
// The layout coordinates of
|
|
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
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
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
|
-
|
|
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 =
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
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
|
-
[![
|
|
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
|
-
|
|
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
|
-
|
|
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-
|
|
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/
|
|
8
|
+
"url": "git+https://github.com/react/react-native.git",
|
|
9
9
|
"directory": "packages/virtualized-lists"
|
|
10
10
|
},
|
|
11
|
-
"homepage": "https://github.com/
|
|
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/
|
|
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-
|
|
56
|
+
"react-native": "0.87.0-nightly-20260618-e1b0c7750"
|
|
57
57
|
},
|
|
58
58
|
"peerDependenciesMeta": {
|
|
59
59
|
"@types/react": {
|