@react-native/virtualized-lists 0.72.3 → 0.73.0

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.
@@ -1886,6 +1886,19 @@ class VirtualizedList extends StateSafePureComponent<Props, State> {
1886
1886
  const focusedCellIndex = lastFocusedCellRenderer.props.index;
1887
1887
  const itemCount = props.getItemCount(props.data);
1888
1888
 
1889
+ // The last cell we rendered may be at a new index. Bail if we don't know
1890
+ // where it is.
1891
+ if (
1892
+ focusedCellIndex >= itemCount ||
1893
+ this._keyExtractor(
1894
+ props.getItem(props.data, focusedCellIndex),
1895
+ focusedCellIndex,
1896
+ props,
1897
+ ) !== this._lastFocusedCellKey
1898
+ ) {
1899
+ return [];
1900
+ }
1901
+
1889
1902
  let first = focusedCellIndex;
1890
1903
  let heightOfCellsBeforeFocused = 0;
1891
1904
  for (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native/virtualized-lists",
3
- "version": "0.72.3",
3
+ "version": "0.73.0",
4
4
  "description": "Virtualized lists for React Native.",
5
5
  "repository": {
6
6
  "type": "git",