I created a little example on codesandbox to reproduce it.
https://codesandbox.io/s/infallible-swirles-cbx74
I can easily cycle through the items
array thanks to the following useEffect
useEffect(() => {
// taking the first element of the array and placing it at its end
const h = () => set(items => [...items.slice(1), items[0]])
setInterval(h, 2000)
return () => {
clearInterval(h)
}
}, [])
The problem is that I cannot find a way to have these animate. I think it might probably be related to the keys
but I cannot figure out how I can fix this.
Please check the codeSandbox link to understand what the problem is and to view the full example code.