Closed TainedeBlaze closed 1 year ago
@TainedeBlaze The problem is the structure that you are using:
<TrailingActions>
<div className="swipeActionDelete">
<SwipeAction destructive={true} onClick={() => HandleDeleteComment(item.comment)}>
Delete
</SwipeAction>
</div>
</TrailingActions>
You shouldn't use div
inside the TrailingActions
- only SwipeAction
can be child of TrailingActions
:
<TrailingActions>
<SwipeAction destructive={true} onClick={() => HandleDeleteComment(item.comment)}>
Delete
</SwipeAction>
</TrailingActions>
Describe the bug I have implemented the react swipeable list component within a comments list on a basic react web application I am building, each time i attempt to swipe right on a comment to delete it, on my localhost I trigger an uncaught runtime error, this is attached below: react-swipeable-list.umd.js:672 Uncaught TypeError: _this.trailingFullSwipeAction is not a function at SwipeableListItem.handleDragEnd (react-swipeable-list.umd.js:672:1) at HTMLDivElement. (react-swipeable-list.umd.js:481:1)
To Reproduce Here is the code of the implementation:
I expect the above code to allow a user to swipe to the left on any comment they have made and be able to delete that comment. A call to the backend would be made in the handle delete comment function, but that has not yet been implemented
Desktop (please complete the following information):
Additional context I had based my code off of the npm docs available at https://www.npmjs.com/package/react-swipeable-list and cannot see this trailingFullSwipeAction property anywhere... any help would be greatly appreciated