I pass ListViewDataSourcedown as a prop and want the child to detect if it is empty or not.
ListViewDataSource
Debugging in Chrome, I see that the property _cachedRowCountmatters 0when the list is empty.
_cachedRowCount
0
Is there a better way to determine if a list view is empty?
Try getRowCount()for example:
getRowCount()
let ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2}); let dataSource = ds.cloneWithRows(this.state.rows || []) console.log(dataSource.getRowCount())
Source: https://habr.com/ru/post/1624766/More articles:Android: datepickerdialog header is not like it. - javaОператор Opera: Opera или OPR? - browserJavaFX, shortcuts, mnemonics, how to avoid sound signals - javaPython string.format (): formatting nans as "some text"? - pythonПрокрутка переполнения без скрытия содержимого - htmlInstalling packages in Racket - lispRedSift INSERT INTO TABLE of CTE - sqlHow to transfer ES6 imports to Chai? - javascriptCreating a PHP session using jQuery / JS - javascriptIncrease Material Lite Lite Progress Bar with Reagent - javascriptAll Articles