react-spring
react-spring copied to clipboard
Typescript error for useTransition
I'm using React with Typescript and getting typing errors for useTransition:
const items = [{id: 1}, {id: 2}];
const transitions = useTransition(items, item => item.id, {
from: { opacity: 0 },
enter: { opacity: 1 },
leave: { opacity: 0 },
})
Resulting in "Expected 1 arguments, but got 3." I'm not sufficient enough in writing types, would be nice if someone can add them.
Dude you are on 7.x.x and trying 8.x.x example. or using 8.x beta where the wrong typing for 7.x was there
The typing is off, but i'm looking at these types and don't understand what i would have to change. If any of you want to submit a pr, they're super welcome!
That's the file: https://github.com/react-spring/react-spring/blob/master/types/web.d.ts
Much appreciated @brunolemos 🙏🏻