const items = [
{ color: 'blue', id: 1 },
{ color: 'purple', id: 2 },
{ color: 'green', id: 3 }
];
const transitions = useTransition(items, (item, index) => item.id, {
config: config.slow,
from: {
transform: 'translateY(-200%)',
opacity: 0,
},
enter: {
transform: 'translateY(0%)',
opacity: 1,
},
leave: {
transform: 'translateY(-200%)',
opacity: 0,
}
});
return transitions.map(transition => {
const { item, key, props } = transition;
return (
<Circle
key={ key }
style={ props }
label={ item.id } />
);
});