formkit / auto-animate

A zero-config, drop-in animation utility that adds smooth transitions to your web app. You can use it with React, Vue, or any other JavaScript application.
https://auto-animate.formkit.com
MIT License
12.59k stars 224 forks source link

React.Children.map issue #201

Closed asmyshlyaev177 closed 5 months ago

asmyshlyaev177 commented 6 months ago

Hi, tnx for library, it's good.

But having an issue when children are remapped, take a look on example https://codesandbox.io/p/sandbox/festive-elion-9lhxw5?file=%252Fsrc%252FApp.tsx and https://asmyshlyaev177.github.io/react-horizontal-scrolling-menu/?path=/story/examples-itemsanimation--items-animation

I'm adding empty divbetween children for using it with scrollIntoView api.

justin-schroeder commented 5 months ago

This is a key issue. The root repeated items need to have a unique key — currently they are just cycling dom elements.