[fix] ListView imports and 'getRowAndSectionCount'

Close #316
This commit is contained in:
Paul Le Cam
2017-01-03 12:17:39 +00:00
committed by Nicolas Gallagher
parent 0aba506725
commit c3d0763944
2 changed files with 7 additions and 2 deletions

View File

@@ -222,6 +222,10 @@ class ListViewDataSource {
return this._cachedRowCount;
}
getRowAndSectionCount(): number {
return (this._cachedRowCount + this.sectionIdentities.length);
}
/**
* Returns if the row is dirtied and needs to be rerendered
*/

View File

@@ -3,7 +3,8 @@ import ListViewDataSource from './ListViewDataSource';
import ListViewPropTypes from './ListViewPropTypes';
import ScrollView from '../ScrollView';
import StaticRenderer from '../StaticRenderer';
import React, { Component, isEmpty, merge } from 'react';
import React, { Component } from 'react';
import isEmpty from 'fbjs/lib/isEmpty';
import requestAnimationFrame from 'fbjs/lib/requestAnimationFrame';
const DEFAULT_PAGE_SIZE = 1;
@@ -245,7 +246,7 @@ class ListView extends Component {
}
if (updatedFrames) {
updatedFrames.forEach((newFrame) => {
this._childFrames[newFrame.index] = merge(newFrame);
this._childFrames[newFrame.index] = Object.assign({}, newFrame);
});
}
const isVertical = !this.props.horizontal;