React | Animation And Transitions | Question 10

Last Updated :
Discuss
Comments

How would you animate a list of items entering and leaving with React Spring?

JavaScript
const transitions = ________(items, {
    from: { opacity: 0 },
    enter: { opacity: 1 },
    leave: { opacity: 0 },
});

return transitions((style, item) => (
    <animated.div style={style}>{item}</animated.div>
));


useState and useEffect

useSpring

useTransition

useReducer

Share your thoughts in the comments