Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Libraries/Lists/VirtualizedList.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ type OptionalProps = {
* unmounts react instances that are outside of the render window. You should only need to disable
* this for debugging purposes.
*/
disableVirtualization: boolean,
disableVirtualization?: ?boolean,
/**
* A marker property for telling the list to re-render (since it implements `PureComponent`). If
* any of your `renderItem`, Header, Footer, etc. functions depend on anything outside of the
Expand Down Expand Up @@ -705,7 +705,7 @@ class VirtualizedList extends React.PureComponent<Props, State> {
};

_isVirtualizationDisabled(): boolean {
return this.props.disableVirtualization;
return this.props.disableVirtualization || false;
}

_isNestedWithSameOrientation(): boolean {
Expand Down
8 changes: 4 additions & 4 deletions Libraries/Lists/VirtualizedSectionList.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ type OptionalProps<SectionT: SectionBase> = {
*/
ItemSeparatorComponent?: ?React.ComponentType<any>,
/**
* Warning: Virtualization can drastically improve memory consumption for long lists, but trashes
* the state of items when they scroll out of the render window, so make sure all relavent data is
* stored outside of the recursive `renderItem` instance tree.
* 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.
*/
enableVirtualization?: ?boolean,
disableVirtualization?: ?boolean,
keyExtractor: (item: Item, index: number) => string,
onEndReached?: ?({distanceFromEnd: number}) => void,
/**
Expand Down
2 changes: 1 addition & 1 deletion RNTester/js/SectionListExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class SectionListExample extends React.PureComponent<{}, $FlowFixMeState> {
)}
debug={this.state.debug}
inverted={this.state.inverted}
enableVirtualization={this.state.virtualized}
disableVirtualization={!this.state.virtualized}
onRefresh={() => Alert.alert('onRefresh: nothing to refresh :P')}
onScroll={this._scrollSinkY}
onViewableItemsChanged={this._onViewableItemsChanged}
Expand Down