diff --git a/packages/react-native-web/src/exports/ListView/ListViewPropTypes.js b/packages/react-native-web/src/exports/ListView/ListViewPropTypes.js
deleted file mode 100644
index fc01905d..00000000
--- a/packages/react-native-web/src/exports/ListView/ListViewPropTypes.js
+++ /dev/null
@@ -1,22 +0,0 @@
-import ListViewDataSource from './ListViewDataSource';
-import ScrollView from '../ScrollView';
-import { arrayOf, bool, func, instanceOf, number } from 'prop-types';
-
-export default {
- ...ScrollView.propTypes,
- dataSource: instanceOf(ListViewDataSource).isRequired,
- renderSeparator: func,
- renderRow: func.isRequired,
- initialListSize: number,
- onEndReached: func,
- onEndReachedThreshold: number,
- pageSize: number,
- renderFooter: func,
- renderHeader: func,
- renderSectionHeader: func,
- renderScrollComponent: func.isRequired,
- scrollRenderAheadDistance: number,
- onChangeVisibleRows: func,
- removeClippedSubviews: bool,
- stickyHeaderIndices: arrayOf(number)
-};
diff --git a/packages/react-native-web/src/exports/ListView/index.js b/packages/react-native-web/src/exports/ListView/index.js
index 3ab42eed..68f4827d 100644
--- a/packages/react-native-web/src/exports/ListView/index.js
+++ b/packages/react-native-web/src/exports/ListView/index.js
@@ -1,444 +1,11 @@
-import applyNativeMethods from '../../modules/applyNativeMethods';
-import ListViewDataSource from './ListViewDataSource';
-import ListViewPropTypes from './ListViewPropTypes';
-import ScrollView from '../ScrollView';
-import StaticRenderer from '../../modules/StaticRenderer';
-import React, { Component } from 'react';
-import isEmpty from 'fbjs/lib/isEmpty';
-import requestAnimationFrame from 'fbjs/lib/requestAnimationFrame';
+/**
+ * Copyright (c) 2016-present, Nicolas Gallagher.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ * @flow
+ */
-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;
-
-class ListView extends Component {
- static propTypes = ListViewPropTypes;
-
- static defaultProps = {
- initialListSize: DEFAULT_INITIAL_ROWS,
- pageSize: DEFAULT_PAGE_SIZE,
- renderScrollComponent: props => ,
- scrollRenderAheadDistance: DEFAULT_SCROLL_RENDER_AHEAD,
- onEndReachedThreshold: DEFAULT_END_REACHED_THRESHOLD,
- scrollEventThrottle: DEFAULT_SCROLL_CALLBACK_THROTTLE,
- removeClippedSubviews: true,
- stickyHeaderIndices: []
- };
-
- static DataSource = ListViewDataSource;
-
- constructor(props) {
- super(props);
- this.state = {
- curRenderedRowsCount: this.props.initialListSize,
- highlightedRow: {}
- };
- this.onRowHighlighted = (sectionId, rowId) => this._onRowHighlighted(sectionId, rowId);
- this.scrollProperties = {};
- }
-
- componentWillMount() {
- // this data should never trigger a render pass, so don't put in state
- this.scrollProperties = {
- visibleLength: null,
- contentLength: null,
- offset: 0
- };
- this._childFrames = [];
- this._visibleRows = {};
- this._prevRenderedRowsCount = 0;
- this._sentEndForContentLength = null;
- }
-
- componentDidMount() {
- // do this in animation frame until componentDidMount actually runs after
- // the component is laid out
- requestAnimationFrame(() => {
- this._measureAndUpdateScrollProps();
- });
- }
-
- componentWillReceiveProps(nextProps: Object) {
- if (
- this.props.dataSource !== nextProps.dataSource ||
- this.props.initialListSize !== nextProps.initialListSize
- ) {
- this.setState(
- (state, props) => {
- this._prevRenderedRowsCount = 0;
- return {
- curRenderedRowsCount: Math.min(
- Math.max(state.curRenderedRowsCount, props.initialListSize),
- props.enableEmptySections
- ? props.dataSource.getRowAndSectionCount()
- : props.dataSource.getRowCount()
- )
- };
- },
- () => this._renderMoreRowsIfNeeded()
- );
- }
- }
-
- componentDidUpdate() {
- requestAnimationFrame(() => {
- this._measureAndUpdateScrollProps();
- });
- }
-
- getScrollResponder() {
- return this._scrollViewRef && this._scrollViewRef.getScrollResponder();
- }
-
- scrollTo(...args) {
- return this._scrollViewRef && this._scrollViewRef.scrollTo(...args);
- }
-
- setNativeProps(props) {
- return this._scrollViewRef && this._scrollViewRef.setNativeProps(props);
- }
-
- _onRowHighlighted = (sectionId, rowId) => {
- this.setState({ highlightedRow: { sectionId, rowId } });
- };
-
- renderSectionHeaderFn = (data, sectionID) => {
- return () => this.props.renderSectionHeader(data, sectionID);
- };
-
- renderRowFn = (data, sectionID, rowID) => {
- return () => this.props.renderRow(data, sectionID, rowID, this._onRowHighlighted);
- };
-
- render() {
- const children = [];
-
- const {
- dataSource,
- enableEmptySections,
- renderFooter,
- renderHeader,
- renderScrollComponent,
- renderSectionHeader,
- renderSeparator,
- /* eslint-disable */
- initialListSize,
- onChangeVisibleRows,
- onEndReached,
- onEndReachedThreshold,
- onKeyboardDidHide,
- onKeyboardDidShow,
- onKeyboardWillHide,
- onKeyboardWillShow,
- pageSize,
- renderRow,
- scrollRenderAheadDistance,
- stickyHeaderIndices,
- /* eslint-enable */
- ...scrollProps
- } = this.props;
-
- const allRowIDs = dataSource.rowIdentities;
- let rowCount = 0;
- const sectionHeaderIndices = [];
-
- const header = renderHeader && renderHeader();
- const footer = renderFooter && renderFooter();
- let totalIndex = header ? 1 : 0;
-
- for (let sectionIdx = 0; sectionIdx < allRowIDs.length; sectionIdx++) {
- const sectionID = dataSource.sectionIdentities[sectionIdx];
- const rowIDs = allRowIDs[sectionIdx];
- if (rowIDs.length === 0) {
- if (enableEmptySections === undefined) {
- const warning = require('fbjs/lib/warning');
- warning(
- false,
- 'In next release empty section headers will be rendered.' +
- " In this release you can use 'enableEmptySections' flag to render empty section headers."
- );
- continue;
- } else {
- const invariant = require('fbjs/lib/invariant');
- invariant(
- enableEmptySections,
- "In next release 'enableEmptySections' flag will be deprecated," +
- ' empty section headers will always be rendered. If empty section headers' +
- ' are not desirable their indices should be excluded from sectionIDs object.' +
- " In this release 'enableEmptySections' may only have value 'true'" +
- ' to allow empty section headers rendering.'
- );
- }
- }
-
- if (renderSectionHeader) {
- const shouldUpdateHeader =
- rowCount >= this._prevRenderedRowsCount &&
- dataSource.sectionHeaderShouldUpdate(sectionIdx);
- children.push(
-
- );
- sectionHeaderIndices.push(totalIndex++);
- }
-
- for (let rowIdx = 0; rowIdx < rowIDs.length; rowIdx++) {
- const rowID = rowIDs[rowIdx];
- const comboID = `${sectionID}_${rowID}`;
- const shouldUpdateRow =
- rowCount >= this._prevRenderedRowsCount && dataSource.rowShouldUpdate(sectionIdx, rowIdx);
- const row = (
-
- );
- children.push(row);
- totalIndex++;
-
- if (
- renderSeparator &&
- (rowIdx !== rowIDs.length - 1 || sectionIdx === allRowIDs.length - 1)
- ) {
- const adjacentRowHighlighted =
- this.state.highlightedRow.sectionID === sectionID &&
- (this.state.highlightedRow.rowID === rowID ||
- this.state.highlightedRow.rowID === rowIDs[rowIdx + 1]);
- const separator = renderSeparator(sectionID, rowID, adjacentRowHighlighted);
- if (separator) {
- children.push(separator);
- totalIndex++;
- }
- }
- if (++rowCount === this.state.curRenderedRowsCount) {
- break;
- }
- }
- if (rowCount >= this.state.curRenderedRowsCount) {
- break;
- }
- }
- scrollProps.onScroll = this._onScroll;
-
- return React.cloneElement(
- renderScrollComponent(scrollProps),
- {
- ref: this._setScrollViewRef,
- onContentSizeChange: this._onContentSizeChange,
- onLayout: this._onLayout
- },
- header,
- children,
- footer
- );
- }
-
- _measureAndUpdateScrollProps() {
- const scrollComponent = this.getScrollResponder();
- if (!scrollComponent || !scrollComponent.getInnerViewNode) {
- return;
- }
-
- this._updateVisibleRows();
- }
-
- _onLayout = (event: Object) => {
- const { width, height } = event.nativeEvent.layout;
- const visibleLength = !this.props.horizontal ? height : width;
- if (visibleLength !== this.scrollProperties.visibleLength) {
- this.scrollProperties.visibleLength = visibleLength;
- this._updateVisibleRows();
- this._renderMoreRowsIfNeeded();
- }
- this.props.onLayout && this.props.onLayout(event);
- };
-
- _updateVisibleRows(updatedFrames?: Array