Daydreamer-riri / transition-hooks

An extremely light-weight react transition animation hook which is simpler and easier to use than react-transition-group
https://transition-hooks.netlify.app/
MIT License
12 stars 1 forks source link

When using useListTransition, updating an array of objects often leads to a duplicate div in the DOM #2

Closed kyle-ahlstrom closed 3 months ago

kyle-ahlstrom commented 3 months ago

When using an array of Objects along with the useListTransition hook, I am getting an animation bug where a duplicate div is added into the DOM momentarily and then removed when one of the Objects in the Array is updated resulting in an animation bug. I have ensured that we are using the KeyExtractor correctly and that each parent div has a unique key but I still see this bug persist.

Example: bug example

Code Sandbox (not always reproducible but you can see it occasionally happen when clicking the 'update last item' button) : https://codesandbox.io/p/sandbox/transition-test-forked-7v4hcm

Daydreamer-riri commented 3 months ago

‌‌Hi @kyle-ahlstrom, thank you for identifying this issue! The problem has now been resolved, and you can use v0.3.2 to confirm whether this issue will reoccur.

kyle-ahlstrom commented 3 months ago

@Daydreamer-riri it looks like it's resolved now! thank you for the quick response!