🟡 DisciplinesTab: statBonus and baseValue props are swapped/mismatched #55

Closed
opened 2026-05-18 17:06:37 +02:00 by Anexim · 2 comments
Owner

File: src/components/game/tabs/DisciplinesTab.tsx

The DisciplineCard component declares:

statBonus: string;    // expects a string
baseValue: number;    // expects a number

But at lines 233-244, the actual data is passed backwards:

statBonus={disc.statBonus}              // passes the whole OBJECT { stat: string, baseValue: number }
baseValue={disc.statBonus.baseValue?.toString() ?? '0'}  // passes a STRING

Additionally, inside the component:

  • Line 144: {statBonus} in JSX would render [object Object] at runtime
  • Line 79: parseInt(baseValue) is called on a prop typed as number but actually receiving a string

Impact: Type errors at compile time, and [object Object] rendered in the UI at runtime. Fractional baseValue values (e.g., 0.3 from mana-channeling) are truncated to 0 by parseInt().

Fix: Pass disc.statBonus.stat as the string and disc.statBonus.baseValue as the number, aligning with the component's prop types.

**File:** `src/components/game/tabs/DisciplinesTab.tsx` The `DisciplineCard` component declares: ```ts statBonus: string; // expects a string baseValue: number; // expects a number ``` But at lines 233-244, the actual data is passed backwards: ```tsx statBonus={disc.statBonus} // passes the whole OBJECT { stat: string, baseValue: number } baseValue={disc.statBonus.baseValue?.toString() ?? '0'} // passes a STRING ``` Additionally, inside the component: - Line 144: `{statBonus}` in JSX would render `[object Object]` at runtime - Line 79: `parseInt(baseValue)` is called on a prop typed as `number` but actually receiving a string **Impact:** Type errors at compile time, and `[object Object]` rendered in the UI at runtime. Fractional `baseValue` values (e.g., `0.3` from `mana-channeling`) are truncated to `0` by `parseInt()`. **Fix:** Pass `disc.statBonus.stat` as the string and `disc.statBonus.baseValue` as the number, aligning with the component's prop types.
Anexim added the ai:todo label 2026-05-18 17:06:37 +02:00
n8n-gitea was assigned by Anexim 2026-05-18 17:06:37 +02:00
Author
Owner

[priority: 4] BROKEN FEATURE — DisciplinesTab statBonus and baseValue props swapped/mismatched.

[priority: 4] BROKEN FEATURE — DisciplinesTab statBonus and baseValue props swapped/mismatched.
Author
Owner

Verified fixed. The DisciplineCard component now correctly receives disc.statBonus.stat (string) and disc.statBonus.baseValue (number), matching the component's prop types. The props were already correctly wired.

Verified fixed. The DisciplineCard component now correctly receives `disc.statBonus.stat` (string) and `disc.statBonus.baseValue` (number), matching the component's prop types. The props were already correctly wired.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#55