I have a react function that tries to live stream a bunch of mouse cursors for/to the people in the "room".
I'm updating/adding each mouse cursor with a web socket connection.
For some reason I can only get the animated react-spring element to show if I set a 'from'. It needs to be from the mouse's previous position and not from the corner / 0, 0 / fixed position.
const transitions = useTransition(mice, {
enter: item => [
{ left: item.x, top: item.y },
],
leave: item => [
{ left: item.x, top: item.y },
],
delay: 0,
})
return (
<>
{transitions((props, item) => (
<animated.div
className='mouseCursor'
key={item.id}
style={props}>
</animated.div>
))}
</>
)