Debug "Enter Spire Mode" crashes with React error #185 (infinite render loop) #252
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Steps to reproduce:
Expected: Spire combat UI appears with floor 1
Actual: Full-screen crash with React error #185 "Maximum update depth exceeded". Game requires error boundary recovery.
Root cause: The
SpireCombatPagecomponent has a potential infinite re-render loop. WhenspireModechanges totrue, the component renders and createsseededRandomviauseMemo(() => ..., [currentFloor]). This function is then used intotalRoomsuseMemo which depends on[currentFloor, seededRandom]. TheuseEffect([currentFloor, totalRooms, setCurrentRoom])then callssetCurrentRoom(newRoom)which triggers a store update. IfgetFloorMaxHP(1)orgenerateSpireFloorState(1, 0, totalRooms)returns a new object reference each time, this could trigger another render cycle before React can bail out.Affected files:
src/components/game/tabs/SpireCombatPage/SpireCombatPage.tsx— theseededRandom,totalRooms, anduseEffecthookssrc/lib/game/stores/gameLoopActions.ts—enterSpireModeactionStore:
useCombatStore(spireMode, currentFloor, currentRoom, etc.)Duplicate of issue #250 — same root cause (React #185 infinite render loop in SpireCombatPage). Fix will be tracked under #250.