Transition with non-transitioning parent element #2037
Unanswered
AndriesVDW
asked this question in
Support
Replies: 1 comment
-
Try setting the keys property on the transition config, one example is keys: (item) => item.id |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi guys,
Let's say I have a chessboard that is 2x2, so I've got an array that looks like this:
The way I would then display the board is like this:
This works fine when only adding pieces.
But when a piece is removed, the current transitioning item gets duplicated and now my chessboard has 5 tiles instead of 4.
Is there any way to prevent react-spring from duplicating that item? Or is there another solution to this problem?
Also made a small example showing what I mean:
https://codepen.io/AndriesVDW/pen/OJErMjv
Tried to achieve what I want another way and this also does not seem to work...
Click the square to add a card, click the card again te remove it:
https://codepen.io/AndriesVDW/pen/ExRGNMQ
Note that both examples do work when removing the leave animation.
Beta Was this translation helpful? Give feedback.
All reactions