deanmcpherson / deanmcpherson/react-native-sortable-listview
Is it possible to delete items from the component?
- Dominant language
- JavaScript
- Stars
- 909
- Forks
- 225
- PR merge metrics
- No merged PRs in 30d
Description
Im receiving the imagenesArray from a fetch im doing before all of this.
I load the images and touching the X over the image i have it gets deleted but it holds the row on the listview as it would still exists.
the 'imagenesArray' array is like this = ["www.someimageurl.com","www.someimageurl.com"]
this first screenshot is when i receive the images:

this second screenshot is when i touch the "X" icon on the image i wanna delete

`
borrarItem(index){
console.log(index)
this.state.imagenesArray.splice(index , 1)
imagenesRecibidasNuevo = this.state.imagenesArray
this.setState({imagenesArray:{}})
this.forceUpdate(); //Im trying to refresh the view but it doesnt work
Actions.refresh() //Im trying to refresh the view but it doesnt work
}
{console.log(rowData), console.log(touch),console.log(layout)}}
onRowMoved={e => {
order.splice(e.to, 0, order.splice(e.from, 1)[0]);
console.log(order)
this.forceUpdate();
}}
renderRow={(rowData, section, index) =>
{
this.borrarItem(index)
}
}
/>
}
/>
`
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing borrarItem and how the SortableListView receives this.state.imagenesArray and order. Reproduce the delete action with the issue's image-array example, then verify that the deleted row disappears and the remaining list data is rendered consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react-native
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100