I can't seem to figure out how to use the highlightRow attribute ListView's renderRow.
The ListView.renderRow Documentation states...
(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 function. The separators above and below will be hidden when a row is highlighted. The highlighted state of a row can be reset by calling highlightRow(null).
I'd like to call attention to the line...
ListView can be notified when a row is being highlighted by calling highlightRow function.
when I console.log(rowData, sectionID, rowID, highlightedRow), I can see that the highlightedRow is a function with the following signature...
function(sectionID,rowID){
this.setState({highlightedRow:{sectionID:sectionID,rowID:rowID}});
}
which is called from here in the source code (see this.onRowHighlighted)...
<StaticRenderer
key={'r_' + comboID}
shouldUpdate={!!shouldUpdateRow}
render={this.props.renderRow.bind(
null,
dataSource.getRowData(sectionIdx, rowIdx),
sectionID,
rowID,
this.onRowHighlighted
)}
/>;
Can anyone provide an example how to use highlightRow properly?