react-native-selectablesectionlistview
react-native-selectablesectionlistview copied to clipboard
onCellSelect
trafficstars
Is onCellSelect hooked up? If so how is it used? How do you bind the instance of what is selected and shouldn't the cell be a touchable component?
Ok, it is hooked up. I'm building out an alphabetized version of this where I hope to emulate the Android contacts page so I'm going to add it to the docs there but here is what's needed:
on your touch component (UserCell):
onPress={this.props.onSelect.bind(this)}
I brought the Cell into render of SectionableListView Component in as a Reusable Compoent like this:
const Cell = (props) => {
<UserCell
user = { props.item }
onSelect = {props.onSelect} />
}
...
<SectionabletListView
...
onCellSelect={this.onSelect}
... // outside render()
onSelect() { ...