@react-native/virtualized-lists 0.89.0-rc.0 → 0.90.0-nightly-20261105-25d63d471
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/ChildListCollection.js +3 -3
- package/Lists/FillRateHelper.js +2 -2
- package/Lists/StateSafePureComponent.js +3 -1
- package/Lists/ViewabilityHelper.js +2 -2
- package/Lists/VirtualizedListContext.js +2 -2
- package/Lists/VirtualizedSectionList.js +10 -7
- package/package.json +2 -2
- package/types_generated/Lists/FillRateHelper.d.ts +2 -2
- package/types_generated/Lists/StateSafePureComponent.d.ts +2 -2
- package/types_generated/Lists/ViewabilityHelper.d.ts +2 -2
- package/types_generated/Lists/VirtualizedListContext.d.ts +3 -3
- package/types_generated/Lists/VirtualizedSectionList.d.ts +2 -2
|
@@ -41,7 +41,7 @@ export default class ChildListCollection<TList> {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
forEach(fn: TList => void): void {
|
|
44
|
+
forEach(fn: (v: TList) => void): void {
|
|
45
45
|
// Fast-path for the common case of a list without nested child lists,
|
|
46
46
|
// which avoids allocating a Map iterator on every scroll event.
|
|
47
47
|
if (this._cellKeyToChildren.size === 0) {
|
|
@@ -54,14 +54,14 @@ export default class ChildListCollection<TList> {
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
forEachInCell(cellKey: string, fn: TList => void): void {
|
|
57
|
+
forEachInCell(cellKey: string, fn: (v: TList) => void): void {
|
|
58
58
|
const listSet = this._cellKeyToChildren.get(cellKey) ?? [];
|
|
59
59
|
for (const list of listSet) {
|
|
60
60
|
fn(list);
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
anyInCell(cellKey: string, fn: TList => boolean): boolean {
|
|
64
|
+
anyInCell(cellKey: string, fn: (v: TList) => boolean): boolean {
|
|
65
65
|
const listSet = this._cellKeyToChildren.get(cellKey) ?? [];
|
|
66
66
|
for (const list of listSet) {
|
|
67
67
|
if (fn(list)) {
|
package/Lists/FillRateHelper.js
CHANGED
|
@@ -31,7 +31,7 @@ class Info {
|
|
|
31
31
|
|
|
32
32
|
const DEBUG = false;
|
|
33
33
|
|
|
34
|
-
let _listeners: Array<(Info) => void> = [];
|
|
34
|
+
let _listeners: Array<(v: Info) => void> = [];
|
|
35
35
|
let _minSampleCount = 10;
|
|
36
36
|
/* $FlowFixMe[constant-condition] Error discovered during Constant Condition
|
|
37
37
|
* roll out. See https://fburl.com/workplace/1v97vimq. */
|
|
@@ -53,7 +53,7 @@ class FillRateHelper {
|
|
|
53
53
|
_mostlyBlankStartTime: ?number = null;
|
|
54
54
|
_samplesStartTime: ?number = null;
|
|
55
55
|
|
|
56
|
-
static addListener(callback: FillRateInfo => void): {
|
|
56
|
+
static addListener(callback: (v: FillRateInfo) => void): {
|
|
57
57
|
remove: () => void,
|
|
58
58
|
...
|
|
59
59
|
} {
|
|
@@ -33,7 +33,9 @@ export default class StateSafePureComponent<
|
|
|
33
33
|
|
|
34
34
|
// $FlowFixMe[incompatible-type]
|
|
35
35
|
setState<K extends keyof State>(
|
|
36
|
-
partialState: ?(
|
|
36
|
+
partialState: ?(
|
|
37
|
+
Pick<State, K> | ((v0: State, v1: Props) => ?Pick<State, K>)
|
|
38
|
+
),
|
|
37
39
|
callback?: () => unknown,
|
|
38
40
|
): void {
|
|
39
41
|
if (typeof partialState === 'function') {
|
|
@@ -185,7 +185,7 @@ class ViewabilityHelper {
|
|
|
185
185
|
isViewable: boolean,
|
|
186
186
|
props: CellMetricProps,
|
|
187
187
|
) => ViewToken,
|
|
188
|
-
onViewableItemsChanged: ({
|
|
188
|
+
onViewableItemsChanged: (v: {
|
|
189
189
|
viewableItems: Array<ViewToken>,
|
|
190
190
|
changed: Array<ViewToken>,
|
|
191
191
|
...
|
|
@@ -290,7 +290,7 @@ class ViewabilityHelper {
|
|
|
290
290
|
_onUpdateSync(
|
|
291
291
|
props: CellMetricProps,
|
|
292
292
|
viewableIndicesToCheck: Array<number>,
|
|
293
|
-
onViewableItemsChanged: ({
|
|
293
|
+
onViewableItemsChanged: (v: {
|
|
294
294
|
changed: Array<ViewToken>,
|
|
295
295
|
viewableItems: Array<ViewToken>,
|
|
296
296
|
...
|
|
@@ -27,12 +27,12 @@ type Context = Readonly<{
|
|
|
27
27
|
},
|
|
28
28
|
horizontal: ?boolean,
|
|
29
29
|
getOutermostParentListRef: () => VirtualizedList,
|
|
30
|
-
registerAsNestedChild: ({
|
|
30
|
+
registerAsNestedChild: (v: {
|
|
31
31
|
cellKey: string,
|
|
32
32
|
horizontal?: boolean,
|
|
33
33
|
ref: VirtualizedList,
|
|
34
34
|
}) => void,
|
|
35
|
-
unregisterAsNestedChild: ({ref: VirtualizedList}) => void,
|
|
35
|
+
unregisterAsNestedChild: (v: {ref: VirtualizedList}) => void,
|
|
36
36
|
getCellVisibilityByKey?: (cellKey: string) => ?boolean,
|
|
37
37
|
...
|
|
38
38
|
}>;
|
|
@@ -103,7 +103,7 @@ type OptionalVirtualizedSectionListProps<
|
|
|
103
103
|
* enabled by default on iOS because that is the platform standard there.
|
|
104
104
|
*/
|
|
105
105
|
stickySectionHeadersEnabled?: boolean,
|
|
106
|
-
onEndReached?: ?({distanceFromEnd: number, ...}) => void,
|
|
106
|
+
onEndReached?: ?(v: {distanceFromEnd: number, ...}) => void,
|
|
107
107
|
};
|
|
108
108
|
|
|
109
109
|
export type VirtualizedSectionListProps<
|
|
@@ -426,7 +426,7 @@ class VirtualizedSectionList<
|
|
|
426
426
|
|
|
427
427
|
_setUpdateHighlightFor = (
|
|
428
428
|
cellKey: string,
|
|
429
|
-
updateHighlightFn: ?(boolean) => void,
|
|
429
|
+
updateHighlightFn: ?(v: boolean) => void,
|
|
430
430
|
) => {
|
|
431
431
|
if (updateHighlightFn != null) {
|
|
432
432
|
this._updateHighlightMap[cellKey] = updateHighlightFn;
|
|
@@ -435,7 +435,10 @@ class VirtualizedSectionList<
|
|
|
435
435
|
}
|
|
436
436
|
};
|
|
437
437
|
|
|
438
|
-
_setUpdatePropsFor = (
|
|
438
|
+
_setUpdatePropsFor = (
|
|
439
|
+
cellKey: string,
|
|
440
|
+
updatePropsFn: ?(v: boolean) => void,
|
|
441
|
+
) => {
|
|
439
442
|
if (updatePropsFn != null) {
|
|
440
443
|
this._updatePropsMap[cellKey] = updatePropsFn;
|
|
441
444
|
} else {
|
|
@@ -467,8 +470,8 @@ class VirtualizedSectionList<
|
|
|
467
470
|
return null;
|
|
468
471
|
}
|
|
469
472
|
|
|
470
|
-
_updateHighlightMap: {[string]: (boolean) => void} = {};
|
|
471
|
-
_updatePropsMap: {[string]: void | (boolean => void)} = {};
|
|
473
|
+
_updateHighlightMap: {[string]: (v: boolean) => void} = {};
|
|
474
|
+
_updatePropsMap: {[string]: void | ((v: boolean) => void)} = {};
|
|
472
475
|
_listRef: ?VirtualizedList;
|
|
473
476
|
_captureRef = (ref: null | VirtualizedList) => {
|
|
474
477
|
this._listRef = ref;
|
|
@@ -492,11 +495,11 @@ type ItemWithSeparatorProps<ItemT> = Readonly<{
|
|
|
492
495
|
item: ItemT,
|
|
493
496
|
setSelfHighlightCallback: (
|
|
494
497
|
cellKey: string,
|
|
495
|
-
updateFn: ?(boolean) => void,
|
|
498
|
+
updateFn: ?(v: boolean) => void,
|
|
496
499
|
) => void,
|
|
497
500
|
setSelfUpdatePropsCallback: (
|
|
498
501
|
cellKey: string,
|
|
499
|
-
updateFn: ?(boolean) => void,
|
|
502
|
+
updateFn: ?(v: boolean) => void,
|
|
500
503
|
) => void,
|
|
501
504
|
prevCellKey?: ?string,
|
|
502
505
|
updateHighlightFor: (prevCellKey: string, value: boolean) => void,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native/virtualized-lists",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.90.0-nightly-20261105-25d63d471",
|
|
4
4
|
"description": "Virtualized lists for React Native.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"@types/react": "^19.2.0",
|
|
55
55
|
"react": "*",
|
|
56
|
-
"react-native": "0.
|
|
56
|
+
"react-native": "0.90.0-nightly-20261105-25d63d471"
|
|
57
57
|
},
|
|
58
58
|
"peerDependenciesMeta": {
|
|
59
59
|
"@types/react": {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<e318967361ec765da21b2aa9f19c6a77>>
|
|
8
8
|
*
|
|
9
9
|
* This file was translated from Flow by scripts/js-api/build-types/index.js.
|
|
10
10
|
* Original file: packages/virtualized-lists/Lists/FillRateHelper.js
|
|
@@ -34,7 +34,7 @@ declare class Info {
|
|
|
34
34
|
* the active scene/route to determine the context of the events.
|
|
35
35
|
*/
|
|
36
36
|
declare class FillRateHelper {
|
|
37
|
-
static addListener(callback: (
|
|
37
|
+
static addListener(callback: (v: FillRateInfo) => void): {
|
|
38
38
|
remove: () => void;
|
|
39
39
|
};
|
|
40
40
|
static setSampleRate(sampleRate: number): void;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<83d56aaad7a4c48fbb9ff7f8121561d0>>
|
|
8
8
|
*
|
|
9
9
|
* This file was translated from Flow by scripts/js-api/build-types/index.js.
|
|
10
10
|
* Original file: packages/virtualized-lists/Lists/StateSafePureComponent.js
|
|
@@ -22,6 +22,6 @@ import * as React from "react";
|
|
|
22
22
|
*/
|
|
23
23
|
declare class StateSafePureComponent<Props, State extends {}> extends React.PureComponent<Props, State> {
|
|
24
24
|
constructor(props: Props);
|
|
25
|
-
setState<K extends keyof State>(partialState: null | undefined | (Pick<State, K> | ((
|
|
25
|
+
setState<K extends keyof State>(partialState: null | undefined | (Pick<State, K> | ((v0: State, v1: Props) => null | undefined | Pick<State, K>)), callback?: () => unknown): void;
|
|
26
26
|
}
|
|
27
27
|
export default StateSafePureComponent;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<8507153552395b0c6c7166ff755bb468>>
|
|
8
8
|
*
|
|
9
9
|
* This file was translated from Flow by scripts/js-api/build-types/index.js.
|
|
10
10
|
* Original file: packages/virtualized-lists/Lists/ViewabilityHelper.js
|
|
@@ -81,7 +81,7 @@ declare class ViewabilityHelper {
|
|
|
81
81
|
* Figures out which items are viewable and how that has changed from before and calls
|
|
82
82
|
* `onViewableItemsChanged` as appropriate.
|
|
83
83
|
*/
|
|
84
|
-
onUpdate(props: CellMetricProps, scrollOffset: number, viewportHeight: number, listMetrics: ListMetricsAggregator, createViewToken: (index: number, isViewable: boolean, props: CellMetricProps) => ViewToken, onViewableItemsChanged: (
|
|
84
|
+
onUpdate(props: CellMetricProps, scrollOffset: number, viewportHeight: number, listMetrics: ListMetricsAggregator, createViewToken: (index: number, isViewable: boolean, props: CellMetricProps) => ViewToken, onViewableItemsChanged: (v: {
|
|
85
85
|
viewableItems: Array<ViewToken>;
|
|
86
86
|
changed: Array<ViewToken>;
|
|
87
87
|
}) => void, renderRange?: {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<1696efded1e1ea2737d3ebea20711aca>>
|
|
8
8
|
*
|
|
9
9
|
* This file was translated from Flow by scripts/js-api/build-types/index.js.
|
|
10
10
|
* Original file: packages/virtualized-lists/Lists/VirtualizedListContext.js
|
|
@@ -26,12 +26,12 @@ type Context = Readonly<{
|
|
|
26
26
|
};
|
|
27
27
|
horizontal: boolean | undefined;
|
|
28
28
|
getOutermostParentListRef: () => VirtualizedList;
|
|
29
|
-
registerAsNestedChild: (
|
|
29
|
+
registerAsNestedChild: (v: {
|
|
30
30
|
cellKey: string;
|
|
31
31
|
horizontal?: boolean | undefined;
|
|
32
32
|
ref: VirtualizedList;
|
|
33
33
|
}) => void;
|
|
34
|
-
unregisterAsNestedChild: (
|
|
34
|
+
unregisterAsNestedChild: (v: {
|
|
35
35
|
ref: VirtualizedList;
|
|
36
36
|
}) => void;
|
|
37
37
|
getCellVisibilityByKey?: ((cellKey: string) => boolean | undefined) | undefined;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<001b00bae1a75289275d4a3743036f55>>
|
|
8
8
|
*
|
|
9
9
|
* This file was translated from Flow by scripts/js-api/build-types/index.js.
|
|
10
10
|
* Original file: packages/virtualized-lists/Lists/VirtualizedSectionList.js
|
|
@@ -84,7 +84,7 @@ type OptionalVirtualizedSectionListProps<ItemT, SectionT = DefaultVirtualizedSec
|
|
|
84
84
|
* enabled by default on iOS because that is the platform standard there.
|
|
85
85
|
*/
|
|
86
86
|
stickySectionHeadersEnabled?: boolean | undefined;
|
|
87
|
-
onEndReached?: ((
|
|
87
|
+
onEndReached?: ((v: {
|
|
88
88
|
distanceFromEnd: number;
|
|
89
89
|
}) => void) | undefined;
|
|
90
90
|
};
|