react-spring icon indicating copy to clipboard operation
react-spring copied to clipboard

Example "You can transition arrays" from Docs does not work

Open unegare opened this issue 3 years ago • 4 comments

🐛 Bug Report

There is an extra move to the right which accumulates in time. The first one takes place with the third iteration of transition

To Reproduce

Steps to reproduce the behavior:

Just run the code

Expected behavior

Just translate in and out of the frame on the same place.

Link to repro (highly encouraged)

https://codesandbox.io/embed/distracted-carlos-6r5c7

Environment

  • react-spring v9.3.1
  • react v17.0.2

unegare avatar Nov 23 '21 17:11 unegare

Hi, this is my first time contributing in github, can I help with this?

MateCon avatar Jan 27 '22 15:01 MateCon

Sure thing @MateCon!

joshuaellis avatar Jan 27 '22 15:01 joshuaellis

I think the problem is that some of the previous instances of the nodes are not being removed, moving the new ones to the right. This only happens with the timeout in useEffect, if it is removed everything works fine, except that the exit animation doesn’t appear.

MateCon avatar Jan 27 '22 15:01 MateCon

When you're ready, just make a PR with the solution and we can discuss in better detail there :)

joshuaellis avatar Jan 27 '22 16:01 joshuaellis