diff --git a/Libraries/Experimental/SwipeableRow/SwipeableFlatList.js b/Libraries/Experimental/SwipeableRow/SwipeableFlatList.js
index 071ee6cdf6e..5bbe37f0a0b 100644
--- a/Libraries/Experimental/SwipeableRow/SwipeableFlatList.js
+++ b/Libraries/Experimental/SwipeableRow/SwipeableFlatList.js
@@ -46,12 +46,10 @@ type State = {|
* A container component that renders multiple SwipeableRow's in a FlatList
* implementation. This is designed to be a drop-in replacement for the
* standard React Native `FlatList`, so use it as if it were a FlatList, but
- * with extra props, i.e.
- *
- *
+ * with extra props.
*
* SwipeableRow can be used independently of this component, but the main
- * benefit of using this component is
+ * benefits of using this component are:
*
* - It ensures that at most 1 row is swiped open (auto closes others)
* - It can bounce the 1st row of the list so users know it's swipeable
diff --git a/Libraries/Experimental/SwipeableRow/SwipeableListView.js b/Libraries/Experimental/SwipeableRow/SwipeableListView.js
deleted file mode 100644
index 3189b728a79..00000000000
--- a/Libraries/Experimental/SwipeableRow/SwipeableListView.js
+++ /dev/null
@@ -1,244 +0,0 @@
-/**
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- *
- * @format
- * @flow
- */
-
-'use strict';
-
-const ListView = require('ListView');
-const React = require('React');
-const SwipeableListViewDataSource = require('SwipeableListViewDataSource');
-const SwipeableRow = require('SwipeableRow');
-
-type ListViewProps = React.ElementConfig;
-
-type Props = $ReadOnly<{|
- ...ListViewProps,
-
- /**
- * To alert the user that swiping is possible, the first row can bounce
- * on component mount.
- */
- bounceFirstRowOnMount: boolean,
- /**
- * Use `SwipeableListView.getNewDataSource()` to get a data source to use,
- * then use it just like you would a normal ListView data source
- */
- dataSource: SwipeableListViewDataSource,
- /**
- * Maximum distance to open to after a swipe
- */
- maxSwipeDistance:
- | number
- | ((rowData: Object, sectionID: string, rowID: string) => number),
- onScroll?: ?Function,
- /**
- * Callback method to render the swipeable view
- */
- renderRow: (
- rowData: Object,
- sectionID: string,
- rowID: string,
- ) => React.Element,
- /**
- * Callback method to render the view that will be unveiled on swipe
- */
- renderQuickActions: (
- rowData: Object,
- sectionID: string,
- rowID: string,
- ) => ?React.Element,
-|}>;
-
-type State = {|
- dataSource: Object,
-|};
-
-/**
- * A container component that renders multiple SwipeableRow's in a ListView
- * implementation. This is designed to be a drop-in replacement for the
- * standard React Native `ListView`, so use it as if it were a ListView, but
- * with extra props, i.e.
- *
- * let ds = SwipeableListView.getNewDataSource();
- * ds.cloneWithRowsAndSections(dataBlob, ?sectionIDs, ?rowIDs);
- * // ..
- *
- *
- * SwipeableRow can be used independently of this component, but the main
- * benefit of using this component is
- *
- * - It ensures that at most 1 row is swiped open (auto closes others)
- * - It can bounce the 1st row of the list so users know it's swipeable
- * - More to come
- */
-class SwipeableListView extends React.Component {
- props: Props;
- state: State;
-
- _listViewRef: ?React.Element = null;
- _shouldBounceFirstRowOnMount: boolean = false;
-
- static getNewDataSource(): Object {
- return new SwipeableListViewDataSource({
- getRowData: (data, sectionID, rowID) => data[sectionID][rowID],
- getSectionHeaderData: (data, sectionID) => data[sectionID],
- rowHasChanged: (row1, row2) => row1 !== row2,
- sectionHeaderHasChanged: (s1, s2) => s1 !== s2,
- });
- }
-
- static defaultProps = {
- bounceFirstRowOnMount: false,
- renderQuickActions: () => null,
- };
-
- constructor(props: Props, context: any): void {
- super(props, context);
-
- this._shouldBounceFirstRowOnMount = this.props.bounceFirstRowOnMount;
- this.state = {
- dataSource: this.props.dataSource,
- };
- }
-
- UNSAFE_componentWillReceiveProps(nextProps: Props): void {
- if (
- this.state.dataSource.getDataSource() !==
- nextProps.dataSource.getDataSource()
- ) {
- this.setState({
- dataSource: nextProps.dataSource,
- });
- }
- }
-
- render(): React.Node {
- return (
- // $FlowFixMe Found when typing ListView
- {
- // $FlowFixMe Found when typing ListView
- this._listViewRef = ref;
- }}
- dataSource={this.state.dataSource.getDataSource()}
- onScroll={this._onScroll}
- renderRow={this._renderRow}
- />
- );
- }
-
- _onScroll = (e): void => {
- // Close any opens rows on ListView scroll
- if (this.props.dataSource.getOpenRowID()) {
- this.setState({
- dataSource: this.state.dataSource.setOpenRowID(null),
- });
- }
- this.props.onScroll && this.props.onScroll(e);
- };
-
- /**
- * This is a work-around to lock vertical `ListView` scrolling on iOS and
- * mimic Android behaviour. Locking vertical scrolling when horizontal
- * scrolling is active allows us to significantly improve framerates
- * (from high 20s to almost consistently 60 fps)
- */
- _setListViewScrollable(value: boolean): void {
- if (
- this._listViewRef &&
- /* $FlowFixMe(>=0.68.0 site=react_native_fb) This comment suppresses an
- * error found when Flow v0.68 was deployed. To see the error delete this
- * comment and run Flow. */
- typeof this._listViewRef.setNativeProps === 'function'
- ) {
- this._listViewRef.setNativeProps({
- scrollEnabled: value,
- });
- }
- }
-
- // Passing through ListView's getScrollResponder() function
- getScrollResponder(): ?Object {
- if (
- this._listViewRef &&
- /* $FlowFixMe(>=0.68.0 site=react_native_fb) This comment suppresses an
- * error found when Flow v0.68 was deployed. To see the error delete this
- * comment and run Flow. */
- typeof this._listViewRef.getScrollResponder === 'function'
- ) {
- return this._listViewRef.getScrollResponder();
- }
- }
-
- // This enables rows having variable width slideoutView.
- _getMaxSwipeDistance(
- rowData: Object,
- sectionID: string,
- rowID: string,
- ): number {
- if (typeof this.props.maxSwipeDistance === 'function') {
- return this.props.maxSwipeDistance(rowData, sectionID, rowID);
- }
-
- return this.props.maxSwipeDistance;
- }
-
- _renderRow = (
- rowData: Object,
- sectionID: string,
- rowID: string,
- ): React.Element => {
- const slideoutView = this.props.renderQuickActions(
- rowData,
- sectionID,
- rowID,
- );
-
- // If renderQuickActions is unspecified or returns falsey, don't allow swipe
- if (!slideoutView) {
- return this.props.renderRow(rowData, sectionID, rowID);
- }
-
- let shouldBounceOnMount = false;
- if (this._shouldBounceFirstRowOnMount) {
- this._shouldBounceFirstRowOnMount = false;
- shouldBounceOnMount = rowID === this.props.dataSource.getFirstRowID();
- }
-
- return (
- this._onOpen(rowData.id)}
- onClose={() => this._onClose(rowData.id)}
- onSwipeEnd={() => this._setListViewScrollable(true)}
- onSwipeStart={() => this._setListViewScrollable(false)}
- shouldBounceOnMount={shouldBounceOnMount}>
- {this.props.renderRow(rowData, sectionID, rowID)}
-
- );
- };
-
- _onOpen(rowID: string): void {
- this.setState({
- dataSource: this.state.dataSource.setOpenRowID(rowID),
- });
- }
-
- _onClose(rowID: string): void {
- this.setState({
- dataSource: this.state.dataSource.setOpenRowID(null),
- });
- }
-}
-
-module.exports = SwipeableListView;
diff --git a/Libraries/Experimental/SwipeableRow/SwipeableListViewDataSource.js b/Libraries/Experimental/SwipeableRow/SwipeableListViewDataSource.js
deleted file mode 100644
index 38e03c66140..00000000000
--- a/Libraries/Experimental/SwipeableRow/SwipeableListViewDataSource.js
+++ /dev/null
@@ -1,116 +0,0 @@
-/**
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- *
- * @format
- */
-
-'use strict';
-
-const ListViewDataSource = require('ListViewDataSource');
-
-/**
- * Data source wrapper around ListViewDataSource to allow for tracking of
- * which row is swiped open and close opened row(s) when another row is swiped
- * open.
- *
- * See https://github.com/facebook/react-native/pull/5602 for why
- * ListViewDataSource is not subclassed.
- */
-class SwipeableListViewDataSource {
- _previousOpenRowID: string;
- _openRowID: string;
-
- _dataBlob: any;
- _dataSource: ListViewDataSource;
-
- rowIdentities: Array>;
- sectionIdentities: Array;
-
- constructor(params: Object) {
- this._dataSource = new ListViewDataSource({
- getRowData: params.getRowData,
- getSectionHeaderData: params.getSectionHeaderData,
- rowHasChanged: (row1, row2) => {
- /**
- * Row needs to be re-rendered if its swiped open/close status is
- * changed, or its data blob changed.
- */
- return (
- (row1.id !== this._previousOpenRowID &&
- row2.id === this._openRowID) ||
- (row1.id === this._previousOpenRowID &&
- row2.id !== this._openRowID) ||
- params.rowHasChanged(row1, row2)
- );
- },
- sectionHeaderHasChanged: params.sectionHeaderHasChanged,
- });
- }
-
- cloneWithRowsAndSections(
- dataBlob: any,
- sectionIdentities: ?Array,
- rowIdentities: ?Array>,
- ): SwipeableListViewDataSource {
- this._dataSource = this._dataSource.cloneWithRowsAndSections(
- dataBlob,
- sectionIdentities,
- rowIdentities,
- );
-
- this._dataBlob = dataBlob;
- this.rowIdentities = this._dataSource.rowIdentities;
- this.sectionIdentities = this._dataSource.sectionIdentities;
-
- return this;
- }
-
- // For the actual ListView to use
- getDataSource(): ListViewDataSource {
- return this._dataSource;
- }
-
- getOpenRowID(): ?string {
- return this._openRowID;
- }
-
- getFirstRowID(): ?string {
- /**
- * If rowIdentities is specified, find the first data row from there since
- * we don't want to attempt to bounce section headers. If unspecified, find
- * the first data row from _dataBlob.
- */
- if (this.rowIdentities) {
- return this.rowIdentities[0] && this.rowIdentities[0][0];
- }
- return Object.keys(this._dataBlob)[0];
- }
-
- getLastRowID(): ?string {
- if (this.rowIdentities && this.rowIdentities.length) {
- const lastSection = this.rowIdentities[this.rowIdentities.length - 1];
- if (lastSection && lastSection.length) {
- return lastSection[lastSection.length - 1];
- }
- }
- return Object.keys(this._dataBlob)[this._dataBlob.length - 1];
- }
-
- setOpenRowID(rowID: string): SwipeableListViewDataSource {
- this._previousOpenRowID = this._openRowID;
- this._openRowID = rowID;
-
- this._dataSource = this._dataSource.cloneWithRowsAndSections(
- this._dataBlob,
- this.sectionIdentities,
- this.rowIdentities,
- );
-
- return this;
- }
-}
-
-module.exports = SwipeableListViewDataSource;
diff --git a/Libraries/Lists/ListView/InternalListViewType.js b/Libraries/Lists/ListView/InternalListViewType.js
deleted file mode 100644
index c8eaddf392f..00000000000
--- a/Libraries/Lists/ListView/InternalListViewType.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- *
- * @format
- * @flow
- */
-
-const React = require('React');
-const ListViewDataSource = require('ListViewDataSource');
-
-// This class is purely a facsimile of ListView so that we can
-// properly type it with Flow before migrating ListView off of
-// createReactClass. If there are things missing here that are in
-// ListView, that is unintentional.
-class InternalListViewType extends React.Component {
- static DataSource = ListViewDataSource;
- setNativeProps(props: Object) {}
- flashScrollIndicators() {}
- getScrollResponder(): any {}
- getScrollableNode(): any {}
- getMetrics(): Object {}
- scrollTo(...args: Array) {}
- scrollToEnd(options?: ?{animated?: ?boolean}) {}
-}
-
-module.exports = InternalListViewType;
diff --git a/Libraries/Lists/ListView/ListView.js b/Libraries/Lists/ListView/ListView.js
deleted file mode 100644
index 193ca055d63..00000000000
--- a/Libraries/Lists/ListView/ListView.js
+++ /dev/null
@@ -1,766 +0,0 @@
-/**
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- *
- * @flow
- * @format
- */
-'use strict';
-
-const InternalListViewType = require('InternalListViewType');
-const ListViewDataSource = require('ListViewDataSource');
-const Platform = require('Platform');
-const React = require('React');
-const ReactNative = require('ReactNative');
-const RCTScrollViewManager = require('NativeModules').ScrollViewManager;
-const ScrollView = require('ScrollView');
-const ScrollResponder = require('ScrollResponder');
-const StaticRenderer = require('StaticRenderer');
-const View = require('View');
-const cloneReferencedElement = require('react-clone-referenced-element');
-const createReactClass = require('create-react-class');
-const isEmpty = require('isEmpty');
-const merge = require('merge');
-
-import type {Props as ScrollViewProps} from 'ScrollView';
-
-const DEFAULT_PAGE_SIZE = 1;
-const DEFAULT_INITIAL_ROWS = 10;
-const DEFAULT_SCROLL_RENDER_AHEAD = 1000;
-const DEFAULT_END_REACHED_THRESHOLD = 1000;
-const DEFAULT_SCROLL_CALLBACK_THROTTLE = 50;
-
-type Props = $ReadOnly<{|
- ...ScrollViewProps,
-
- /**
- * An instance of [ListView.DataSource](docs/listviewdatasource.html) to use
- */
- dataSource: ListViewDataSource,
- /**
- * (sectionID, rowID, adjacentRowHighlighted) => renderable
- *
- * If provided, a renderable component to be rendered as the separator
- * below each row but not the last row if there is a section header below.
- * Take a sectionID and rowID of the row above and whether its adjacent row
- * is highlighted.
- */
- renderSeparator?: ?Function,
- /**
- * (rowData, sectionID, rowID, highlightRow) => renderable
- *
- * Takes a data entry from the data source and its ids and should return
- * a renderable component to be rendered as the row. By default the data
- * is exactly what was put into the data source, but it's also possible to
- * provide custom extractors. ListView can be notified when a row is
- * being highlighted by calling `highlightRow(sectionID, rowID)`. This
- * sets a boolean value of adjacentRowHighlighted in renderSeparator, allowing you
- * to control the separators above and below the highlighted row. The highlighted
- * state of a row can be reset by calling highlightRow(null).
- */
- renderRow: Function,
- /**
- * How many rows to render on initial component mount. Use this to make
- * it so that the first screen worth of data appears at one time instead of
- * over the course of multiple frames.
- */
- initialListSize?: ?number,
- /**
- * Called when all rows have been rendered and the list has been scrolled
- * to within onEndReachedThreshold of the bottom. The native scroll
- * event is provided.
- */
- onEndReached?: ?Function,
- /**
- * Threshold in pixels (virtual, not physical) for calling onEndReached.
- */
- onEndReachedThreshold?: ?number,
- /**
- * Number of rows to render per event loop. Note: if your 'rows' are actually
- * cells, i.e. they don't span the full width of your view (as in the
- * ListViewGridLayoutExample), you should set the pageSize to be a multiple
- * of the number of cells per row, otherwise you're likely to see gaps at
- * the edge of the ListView as new pages are loaded.
- */
- pageSize?: ?number,
- /**
- * () => renderable
- *
- * The header and footer are always rendered (if these props are provided)
- * on every render pass. If they are expensive to re-render, wrap them
- * in StaticContainer or other mechanism as appropriate. Footer is always
- * at the bottom of the list, and header at the top, on every render pass.
- * In a horizontal ListView, the header is rendered on the left and the
- * footer on the right.
- */
- renderFooter?: ?Function,
- renderHeader?: ?Function,
- /**
- * (sectionData, sectionID) => renderable
- *
- * If provided, a header is rendered for this section.
- */
- renderSectionHeader?: ?Function,
- /**
- * (props) => renderable
- *
- * A function that returns the scrollable component in which the list rows
- * are rendered. Defaults to returning a ScrollView with the given props.
- */
- renderScrollComponent?: ?Function,
- /**
- * How early to start rendering rows before they come on screen, in
- * pixels.
- */
- scrollRenderAheadDistance?: ?number,
- /**
- * (visibleRows, changedRows) => void
- *
- * Called when the set of visible rows changes. `visibleRows` maps
- * { sectionID: { rowID: true }} for all the visible rows, and
- * `changedRows` maps { sectionID: { rowID: true | false }} for the rows
- * that have changed their visibility, with true indicating visible, and
- * false indicating the view has moved out of view.
- */
- onChangeVisibleRows?: ?Function,
- /**
- * A performance optimization for improving scroll perf of
- * large lists, used in conjunction with overflow: 'hidden' on the row
- * containers. This is enabled by default.
- */
- removeClippedSubviews?: ?boolean,
- /**
- * Makes the sections headers sticky. The sticky behavior means that it
- * will scroll with the content at the top of the section until it reaches
- * the top of the screen, at which point it will stick to the top until it
- * is pushed off the screen by the next section header. This property is
- * not supported in conjunction with `horizontal={true}`. Only enabled by
- * default on iOS because of typical platform standards.
- */
- stickySectionHeadersEnabled?: ?boolean,
- /**
- * An array of child indices determining which children get docked to the
- * top of the screen when scrolling. For example, passing
- * `stickyHeaderIndices={[0]}` will cause the first child to be fixed to the
- * top of the scroll view. This property is not supported in conjunction
- * with `horizontal={true}`.
- */
- stickyHeaderIndices?: ?$ReadOnlyArray,
- /**
- * Flag indicating whether empty section headers should be rendered. In the future release
- * empty section headers will be rendered by default, and the flag will be deprecated.
- * If empty sections are not desired to be rendered their indices should be excluded from sectionID object.
- */
- enableEmptySections?: ?boolean,
-|}>;
-
-/**
- * DEPRECATED - use one of the new list components, such as [`FlatList`](docs/flatlist.html)
- * or [`SectionList`](docs/sectionlist.html) for bounded memory use, fewer bugs,
- * better performance, an easier to use API, and more features. Check out this
- * [blog post](https://facebook.github.io/react-native/blog/2017/03/13/better-list-views.html)
- * for more details.
- *
- * ListView - A core component designed for efficient display of vertically
- * scrolling lists of changing data. The minimal API is to create a
- * [`ListView.DataSource`](docs/listviewdatasource.html), populate it with a simple
- * array of data blobs, and instantiate a `ListView` component with that data
- * source and a `renderRow` callback which takes a blob from the data array and
- * returns a renderable component.
- *
- * Minimal example:
- *
- * ```
- * class MyComponent extends Component {
- * constructor() {
- * super();
- * const ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});
- * this.state = {
- * dataSource: ds.cloneWithRows(['row 1', 'row 2']),
- * };
- * }
- *
- * render() {
- * return (
- * {rowData}}
- * />
- * );
- * }
- * }
- * ```
- *
- * ListView also supports more advanced features, including sections with sticky
- * section headers, header and footer support, callbacks on reaching the end of
- * the available data (`onEndReached`) and on the set of rows that are visible
- * in the device viewport change (`onChangeVisibleRows`), and several
- * performance optimizations.
- *
- * There are a few performance operations designed to make ListView scroll
- * smoothly while dynamically loading potentially very large (or conceptually
- * infinite) data sets:
- *
- * * Only re-render changed rows - the rowHasChanged function provided to the
- * data source tells the ListView if it needs to re-render a row because the
- * source data has changed - see ListViewDataSource for more details.
- *
- * * Rate-limited row rendering - By default, only one row is rendered per
- * event-loop (customizable with the `pageSize` prop). This breaks up the
- * work into smaller chunks to reduce the chance of dropping frames while
- * rendering rows.
- */
-
-const ListView = createReactClass({
- displayName: 'ListView',
- _rafIds: ([]: Array),
- _childFrames: ([]: Array