Remove legacyImplementation from FlatList and SectionList
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
This commit is contained in:
parent
b32029f346
commit
636d01bbd0
|
@ -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.
|
||||
*/
|
||||
|
|
|
@ -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> &
|
||||
|
@ -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. */
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -96,7 +96,6 @@ class MultiColumnExample extends React.PureComponent<
|
|||
renderItem={this._renderItemComponent}
|
||||
disableVirtualization={!this.state.virtualized}
|
||||
onViewableItemsChanged={this._onViewableItemsChanged}
|
||||
legacyImplementation={false}
|
||||
/>
|
||||
</RNTesterPage>
|
||||
);
|
||||
|
|
|
@ -111,7 +111,6 @@ class RNTesterExampleList extends React.Component<Props, $FlowFixMeState> {
|
|||
keyboardShouldPersistTaps="handled"
|
||||
automaticallyAdjustContentInsets={false}
|
||||
keyboardDismissMode="on-drag"
|
||||
legacyImplementation={false}
|
||||
renderSectionHeader={renderSectionHeader}
|
||||
/>
|
||||
</View>
|
||||
|
|
Loading…
Reference in New Issue