mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-07 23:27:05 +08:00
render empty section headers
Summary:Changed behavior so that empty section headers are rendered, fixes this [issue](https://github.com/facebook/react-native/issues/5639). Closes https://github.com/facebook/react-native/pull/5713 Differential Revision: D3053765 Pulled By: sahrens fb-gh-sync-id: 59a78a4b19288b2acc04a7b166de8c2ad16eacd7 shipit-source-id: 59a78a4b19288b2acc04a7b166de8c2ad16eacd7
This commit is contained in:
committed by
Facebook Github Bot 5
parent
d5445d5fbc
commit
e07fe0cc60
@@ -186,6 +186,11 @@ class ListViewDataSource {
|
||||
typeof this._sectionHeaderHasChanged === 'function',
|
||||
'Must provide a sectionHeaderHasChanged function with section data.'
|
||||
);
|
||||
invariant(
|
||||
!sectionIdentities || !rowIdentities || sectionIdentities.length === rowIdentities.length,
|
||||
'row and section ids lengths must be the same'
|
||||
);
|
||||
|
||||
var newSource = new ListViewDataSource({
|
||||
getRowData: this._getRowData,
|
||||
getSectionHeaderData: this._getSectionHeaderData,
|
||||
@@ -221,6 +226,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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user