How it works...
In step 5, we defined the swiping property on the state. This property is just a Boolean that will be set to true when the dragging starts and to false when it has completed. We need this information in order to lock the vertical scrolling on the list while dragging around the item.
In step 7, we defined the content of each row in the list. The onDragStart property receives the handleToggleSwipe method, which will be executed when the dragging starts. We are also going to execute the same method when the dragging is completed.
In the same step, we also send the handleRemoveContact method to each item. As the name suggests, we are going to remove the current item from the list when the user swipes it out.
In step 11, we defined ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access