Skip to content

Commit

Permalink
Remove disableVirtualization from defaultProps
Browse files Browse the repository at this point in the history
Summary:
Changelog:
[Internal][Changed] - Remove disableVirtualization from defaultProps as part of larger effort to remove defaultProps from VirtualizedList

Reviewed By: nadiia

Differential Revision: D26969587

fbshipit-source-id: 662fa620bc5b6b9a64c1906f62dae1f4b373a23b
  • Loading branch information
Luna Wei authored and facebook-github-bot committed Mar 16, 2021
1 parent c4c0065 commit 3ff7e86
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 45 deletions.
4 changes: 1 addition & 3 deletions Libraries/Lists/VirtualizedList.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ type OptionalProps = {|
/**
* DEPRECATED: Virtualization provides significant performance and memory optimizations, but fully
* unmounts react instances that are outside of the render window. You should only need to disable
* this for debugging purposes.
* this for debugging purposes. Defaults to false.
*/
disableVirtualization?: ?boolean,
/**
Expand Down Expand Up @@ -304,7 +304,6 @@ type Props = {|
|};

type DefaultProps = {|
disableVirtualization: boolean,
horizontal: boolean,
initialNumToRender: number,
keyExtractor: (item: Item, index: number) => string,
Expand Down Expand Up @@ -561,7 +560,6 @@ class VirtualizedList extends React.PureComponent<Props, State> {
}

static defaultProps: DefaultProps = {
disableVirtualization: false,
horizontal: false,
initialNumToRender: 10,
keyExtractor: (item: Item, index: number) => {
Expand Down
7 changes: 0 additions & 7 deletions Libraries/Lists/__tests__/__snapshots__/FlatList-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ exports[`FlatList renders all the bells and whistles 1`] = `
},
]
}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
getItemLayout={[Function]}
Expand Down Expand Up @@ -129,7 +128,6 @@ exports[`FlatList renders all the bells and whistles 1`] = `
exports[`FlatList renders empty list 1`] = `
<RCTScrollView
data={Array []}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
horizontal={false}
Expand Down Expand Up @@ -158,7 +156,6 @@ exports[`FlatList renders empty list 1`] = `

exports[`FlatList renders null list 1`] = `
<RCTScrollView
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
horizontal={false}
Expand Down Expand Up @@ -200,7 +197,6 @@ exports[`FlatList renders simple list (multiple columns) 1`] = `
},
]
}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
horizontal={false}
Expand Down Expand Up @@ -278,7 +274,6 @@ exports[`FlatList renders simple list 1`] = `
},
]
}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
horizontal={false}
Expand Down Expand Up @@ -346,7 +341,6 @@ exports[`FlatList renders simple list using ListItemComponent (multiple columns)
},
]
}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
horizontal={false}
Expand Down Expand Up @@ -424,7 +418,6 @@ exports[`FlatList renders simple list using ListItemComponent 1`] = `
},
]
}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
horizontal={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ exports[`SectionList rendering empty section headers is fine 1`] = `
},
]
}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
horizontal={false}
Expand Down Expand Up @@ -81,7 +80,6 @@ exports[`SectionList renders a footer when there is no data 1`] = `
},
]
}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
horizontal={false}
Expand Down Expand Up @@ -137,7 +135,6 @@ exports[`SectionList renders a footer when there is no data and no header 1`] =
},
]
}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
horizontal={false}
Expand Down Expand Up @@ -224,7 +221,6 @@ exports[`SectionList renders all the bells and whistles 1`] = `
},
]
}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
horizontal={false}
Expand Down Expand Up @@ -417,7 +413,6 @@ exports[`SectionList renders all the bells and whistles 1`] = `
exports[`SectionList renders empty list 1`] = `
<RCTScrollView
data={Array []}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
horizontal={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ exports[`VirtualizedList forwards correct stickyHeaderIndices when all in initia
},
]
}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
getItemLayout={[Function]}
Expand Down Expand Up @@ -188,7 +187,6 @@ exports[`VirtualizedList forwards correct stickyHeaderIndices when partially in
},
]
}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
getItemLayout={[Function]}
Expand Down Expand Up @@ -276,7 +274,6 @@ exports[`VirtualizedList handles nested lists 1`] = `
},
]
}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
horizontal={false}
Expand Down Expand Up @@ -313,7 +310,6 @@ exports[`VirtualizedList handles nested lists 1`] = `
},
]
}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
horizontal={false}
Expand Down Expand Up @@ -367,7 +363,6 @@ exports[`VirtualizedList handles nested lists 1`] = `
},
]
}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
horizontal={true}
Expand Down Expand Up @@ -442,7 +437,6 @@ exports[`VirtualizedList handles separators correctly 1`] = `
},
]
}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
horizontal={false}
Expand Down Expand Up @@ -524,7 +518,6 @@ exports[`VirtualizedList handles separators correctly 2`] = `
},
]
}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
horizontal={false}
Expand Down Expand Up @@ -606,7 +599,6 @@ exports[`VirtualizedList handles separators correctly 3`] = `
},
]
}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
horizontal={false}
Expand Down Expand Up @@ -759,7 +751,6 @@ exports[`VirtualizedList keeps sticky headers realized after scrolled out of vie
},
]
}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
getItemLayout={[Function]}
Expand Down Expand Up @@ -953,7 +944,6 @@ exports[`VirtualizedList realizes sticky headers in viewport on batched render 1
},
]
}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
getItemLayout={[Function]}
Expand Down Expand Up @@ -1054,7 +1044,6 @@ exports[`VirtualizedList renders all the bells and whistles 1`] = `
},
]
}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
getItemLayout={[Function]}
Expand Down Expand Up @@ -1239,7 +1228,6 @@ exports[`VirtualizedList renders all the bells and whistles 1`] = `
exports[`VirtualizedList renders empty list 1`] = `
<RCTScrollView
data={Array []}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
horizontal={false}
Expand Down Expand Up @@ -1270,7 +1258,6 @@ exports[`VirtualizedList renders empty list with empty component 1`] = `
ListFooterComponent={[Function]}
ListHeaderComponent={[Function]}
data={Array []}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
horizontal={false}
Expand Down Expand Up @@ -1317,7 +1304,6 @@ exports[`VirtualizedList renders list with empty component 1`] = `
},
]
}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
horizontal={false}
Expand Down Expand Up @@ -1353,7 +1339,6 @@ exports[`VirtualizedList renders list with empty component 1`] = `

exports[`VirtualizedList renders null list 1`] = `
<RCTScrollView
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
horizontal={false}
Expand Down Expand Up @@ -1393,7 +1378,6 @@ exports[`VirtualizedList renders simple list 1`] = `
},
]
}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
horizontal={false}
Expand Down Expand Up @@ -1459,7 +1443,6 @@ exports[`VirtualizedList renders simple list using ListItemComponent 1`] = `
},
]
}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
horizontal={false}
Expand Down Expand Up @@ -1517,7 +1500,6 @@ exports[`VirtualizedList test getItem functionality where data is not an Array 1
},
}
}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
horizontal={false}
Expand Down Expand Up @@ -1561,7 +1543,6 @@ exports[`VirtualizedList warns if both renderItem or ListItemComponent are speci
},
]
}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
horizontal={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ exports[`VirtualizedSectionList handles nested lists 1`] = `
},
]
}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
horizontal={false}
Expand Down Expand Up @@ -63,7 +62,6 @@ exports[`VirtualizedSectionList handles nested lists 1`] = `
},
]
}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
horizontal={false}
Expand Down Expand Up @@ -130,7 +128,6 @@ exports[`VirtualizedSectionList handles nested lists 1`] = `
},
]
}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
horizontal={true}
Expand Down Expand Up @@ -235,7 +232,6 @@ exports[`VirtualizedSectionList handles separators correctly 1`] = `
},
]
}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
horizontal={false}
Expand Down Expand Up @@ -375,7 +371,6 @@ exports[`VirtualizedSectionList handles separators correctly 2`] = `
},
]
}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
horizontal={false}
Expand Down Expand Up @@ -515,7 +510,6 @@ exports[`VirtualizedSectionList handles separators correctly 3`] = `
},
]
}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
horizontal={false}
Expand Down Expand Up @@ -665,7 +659,6 @@ exports[`VirtualizedSectionList renders all the bells and whistles 1`] = `
},
]
}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
getItemLayout={[Function]}
Expand Down Expand Up @@ -890,7 +883,6 @@ exports[`VirtualizedSectionList renders all the bells and whistles 1`] = `
exports[`VirtualizedSectionList renders empty list 1`] = `
<RCTScrollView
data={Array []}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
horizontal={false}
Expand Down Expand Up @@ -921,7 +913,6 @@ exports[`VirtualizedSectionList renders empty list with empty component 1`] = `
ListFooterComponent={[Function]}
ListHeaderComponent={[Function]}
data={Array []}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
horizontal={false}
Expand Down Expand Up @@ -973,7 +964,6 @@ exports[`VirtualizedSectionList renders list with empty component 1`] = `
},
]
}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
horizontal={false}
Expand Down Expand Up @@ -1035,7 +1025,6 @@ exports[`VirtualizedSectionList renders simple list 1`] = `
},
]
}
disableVirtualization={false}
getItem={[Function]}
getItemCount={[Function]}
horizontal={false}
Expand Down

0 comments on commit 3ff7e86

Please sign in to comment.