Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Animation does not work without item id. #224

Open
dotneet opened this issue Jul 2, 2019 · 4 comments
Open

Animation does not work without item id. #224

dotneet opened this issue Jul 2, 2019 · 4 comments
Labels
🐛 bug Something isn't working

Comments

@dotneet
Copy link

dotneet commented Jul 2, 2019

As he mentioned in the comment below, animations does not work without item id.
#223 (comment)

@dotneet
Copy link
Author

dotneet commented Jul 2, 2019

@maximilianoforlenza
Thank you for maintaining very useful package.
I found out that this change breaks animation.

f8eec1e

Why use randomString() instead of index?

@maximilianoforlenza
Copy link
Collaborator

Because index as a key is an anti-pattern

@dotneet
Copy link
Author

dotneet commented Jul 2, 2019

That's correct. But using randomString() in rendering time does not resolve any problem that index as a key cause.
Because keys are changed every rendering time.

Ideally the key for a same data must be same every rendering time.
If it's not possible, using index as a key is better choice than randomString().

@maximilianoforlenza maximilianoforlenza added the 🐛 bug Something isn't working label Jul 2, 2019
@FilipHarald
Copy link

Is there any work around for this? Currently I'm adding .id to my nodes in the collection so that the animation is working. But I would prefer to use their ._id or have randomString() work with animations.

@maximilianoforlenza , thanks for an awesome package!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐛 bug Something isn't working
Development

No branches or pull requests

3 participants