fix(complement-race): fix react-spring interpolation TypeScript errors

Fixed TypeScript errors in transform interpolation by using correct react-spring
syntax: to([spring1, spring2, spring3], (a, b, c) => ...) instead of the
incorrect spring1.to((a, b, c) => ..., spring2, spring3) syntax.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Thomas Hallock 2025-10-22 14:05:11 -05:00
parent 3eb85d7d72
commit 0add9e4ef1
1 changed files with 7 additions and 9 deletions

View File

@ -1,6 +1,6 @@
'use client'
import { useSpring, useSprings, animated } from '@react-spring/web'
import { useSpring, useSprings, animated, to } from '@react-spring/web'
import { useMemo, useRef } from 'react'
import type { PlayerState } from '@/arcade-games/complement-race/types'
import type { RailroadTrackGenerator } from '../../lib/RailroadTrackGenerator'
@ -146,10 +146,9 @@ export function GhostTrain({
<g ref={ghostRef} data-component="ghost-train" data-player-id={player.id}>
{/* Ghost locomotive - animated */}
<animated.g
transform={locomotiveSpring.x.to(
(x, y, rot) => `translate(${x}, ${y}) rotate(${rot}) scale(-1, 1)`,
locomotiveSpring.y,
locomotiveSpring.rotation
transform={to(
[locomotiveSpring.x, locomotiveSpring.y, locomotiveSpring.rotation],
(x, y, rot) => `translate(${x}, ${y}) rotate(${rot}) scale(-1, 1)`
)}
opacity={locomotiveSpring.opacity}
>
@ -208,10 +207,9 @@ export function GhostTrain({
{carSprings.map((spring, index) => (
<animated.g
key={`car-${index}`}
transform={spring.x.to(
(x, y, rot) => `translate(${x}, ${y}) rotate(${rot}) scale(-1, 1)`,
spring.y,
spring.rotation
transform={to(
[spring.x, spring.y, spring.rotation],
(x, y, rot) => `translate(${x}, ${y}) rotate(${rot}) scale(-1, 1)`
)}
opacity={spring.opacity}
>