Skip to content

Commit

Permalink
Remove legacyImplementation from FlatList and SectionList
Browse files Browse the repository at this point in the history
Summary:
`legacyImplementation` has caused a warning in FlatList for a long time. FlatList supports the use cases of the legacy implementation and should be adopted.

We will be removing the deprecated MetroListView and ListView components to reduce bundle sizes and the complexity of the codebase.

Reviewed By: yungsters

Differential Revision: D10245824

fbshipit-source-id: 60ff0d54974649b57bac9f9f29b769f34ca2701c
  • Loading branch information
elicwhite authored and facebook-github-bot committed Oct 10, 2018
1 parent b32029f commit 636d01b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
5 changes: 4 additions & 1 deletion Libraries/Lists/FlatList.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,10 @@ type OptionalProps<ItemT> = {
* @platform android
*/
progressViewOffset?: number,
legacyImplementation?: ?boolean,
/**
* The legacy implementation is no longer supported.
*/
legacyImplementation?: empty,
/**
* Set this true while waiting for new data from a refresh.
*/
Expand Down
9 changes: 5 additions & 4 deletions Libraries/Lists/SectionList.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,10 @@ type OptionalProps<SectionT: SectionBase<any>> = {
*/
stickySectionHeadersEnabled?: boolean,

legacyImplementation?: ?boolean,
/**
* The legacy implementation is no longer supported.
*/
legacyImplementation?: empty,
};

export type Props<SectionT> = RequiredProps<SectionT> &
Expand Down Expand Up @@ -323,9 +326,7 @@ class SectionList<SectionT: SectionBase<any>> extends React.PureComponent<
}

render() {
const List = this.props.legacyImplementation
? MetroListView
: VirtualizedSectionList;
const List = VirtualizedSectionList;
/* $FlowFixMe(>=0.66.0 site=react_native_fb) This comment suppresses an
* error found when Flow v0.66 was deployed. To see the error delete this
* comment and run Flow. */
Expand Down
1 change: 0 additions & 1 deletion RNTester/js/FlatListExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ class FlatListExample extends React.PureComponent<{}, $FlowFixMeState> {
}
keyboardShouldPersistTaps="always"
keyboardDismissMode="on-drag"
legacyImplementation={false}
numColumns={1}
onEndReached={this._onEndReached}
onRefresh={this._onRefresh}
Expand Down
1 change: 0 additions & 1 deletion RNTester/js/MultiColumnExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ class MultiColumnExample extends React.PureComponent<
renderItem={this._renderItemComponent}
disableVirtualization={!this.state.virtualized}
onViewableItemsChanged={this._onViewableItemsChanged}
legacyImplementation={false}
/>
</RNTesterPage>
);
Expand Down
1 change: 0 additions & 1 deletion RNTester/js/RNTesterExampleList.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ class RNTesterExampleList extends React.Component<Props, $FlowFixMeState> {
keyboardShouldPersistTaps="handled"
automaticallyAdjustContentInsets={false}
keyboardDismissMode="on-drag"
legacyImplementation={false}
renderSectionHeader={renderSectionHeader}
/>
</View>
Expand Down

0 comments on commit 636d01b

Please sign in to comment.