Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <SectionList
- renderItem={({item, index}) => {
- Alert.alert(index); // here the index is null
- return (
- <SectionListItem item={item} index={index} parentSectionList={this}>
- </SectionListItem>);
- }}
- sections={this.state.contacts.sort((a, b) => a.title < b.title ? -1 : 1)}
- />
- removeItem = (deletedKey) => {
- this.setState({
- deletedRowKey : deletedKey,
- // here I want to remove my item with deletedKey = index, but deletedKey is null
- contacts: this.state.contacts.splice(1), // works, removing the 1st item from array
- });
- }
- const newContact = {
- title: this.state.contactName.charAt(0),
- data: [{
- name: this.state.contactName,
- phone: this.state.contactPhone
- }]};
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement