Open olegkolt opened 11 months ago
Hi,
Thanks for the info. Got a question - why do you want to put something else than SwipeAction
inside the TrailingActions
?
I would like to understand the usecase.
Hi,
I am mostly about using null
inside TrailingActions
. There is a problem with a code like:
<TrailingActions>
{canDelete ? <SwipeAction ...> : null }
{canArchive ? <SwipeAction ...> : null }
</TrailingActions>
If the last child is null
, _this.trailingFullSwipeAction is not a function
will appear.
Describe the bug In some cases Full Swipe with ≤2 children cases an error:
To Reproduce Create a list of TrailingActions with 'null' as the last child:
Expected behavior No error for cases if some of TrailingActions's children is not valid React element.
Desktop (please complete the following information):
Additional context How to fix: count valid react children before maping: