Reputation: 1596
I'm trying to set up animating in a list of items in React. I'm using Velocity for the animations, and using react/addons
's TransitionGroup
. The easy part is using the index of the item in the list to "stagger" them in, but there's a problem when I load additional data from the server, and add them to the list: the index of the new items are from 20 to [x], so they wait (20 * 300ms) before the first one animates in. Given a number, say 23, is there an easy way to boil this down to 3 (remove 20 in this case, if the number were 55, boil it down to 5). This should be really basic, but I can't get my head around an elegant solution. Any help would be greatly appreciated!
Upvotes: 0
Views: 66