After react-spring useTransition removes the previous element, how to set the following elements to move up?
I just started learning to use react-spring
. Then I set up the array’s appearance and disappearance animation effects, but there was a problem.
What is the difference between the two ways of writing useTransition in react-spring?
“use client”; import React, {memo, useEffect, useState} from ‘react’ import {animated, useTransition} from “@react-spring/web”; const Test = () => { useEffect(() => { changeItem() }, []) const [items, setItems] = useState<string[]>([“1”, “2”, “3”, “4”]); const addItem = () => { const newItem = `Item ${items.length + 1}`; setItems([…items, newItem]); }; const removeItem = () => […]