I am trying to get the current index of renderRow but I dont seem to get it. I have also tried to add i in as a variable inside renderRow. I am making highscore and it would be super convenient if I could just get the number from renderRow itself. If there is another way to get the current number each time then it will also work.
<ListView
dataSource={this.state.dataSource}
renderRow={(rowData, rowID ) =>
<Text style={styles.topStyle}>{rowID}</Text>
}
/>
The renderRow
callback expects a function with 4 arguments renderRow={(rowData, sectionID, rowID, higlightRow) => { ... }}
. I believe rowId
is the one you need.
The docs — http://facebook.github.io/react-native/docs/listview.html#renderrow
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With