dancormier / react-native-swipeout

iOS-style swipeout buttons behind component
MIT License
2.62k stars 646 forks source link

how to render closed swipeout after flatlist rerender #279

Open SK-DNS-NET opened 6 years ago

SK-DNS-NET commented 6 years ago

In a Flatlist each item is a swipeout component. The button of each swipeout item deletes an array element of the flatlist data property. After deleting, the "deleted" swipeout element is still open but with text of the next array element. I don't know if this an issue or feature of flatlist or swipeout - in all cases it is irritating users. Is there any way to close the swipeout button without animation?

matthewjj commented 6 years ago

This is happening for me too.

Would the answer to this be to set a unique key for the swipeout element as apposed to 0,1,2,3 etc?

ecoleman commented 5 years ago

Don't use the array index as a key, use something specific to the row/data being rendered.