Relative Content

Tag Archive for react-spring

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 = () => […]