I created a component that use a ListView
to display a list of contacts. When clicking on a row, I update an array in the state
's component that contains all the selected contacts. However, I'm not using this array as a dataSource
for my ListView
component.
I would like to redraw the ListView
each time this array is modified in order to display an image for the selected contacts.
Here is an example of my current situation:
renderListView: function(){
<ListView
dataSource={this.state.dataSource}
renderRow={this.renderRow}
style={styles.listView}
/>
}
renderRow:function(row){
return if(this.state.something === true) <Text>Something</Text>
else <Text>Something Else</Text>
}
I tried to call .forceUpdate()
, it calls the render
method but not the renderRow
method.
Any suggestion?