bug: React error #31 rendering project tags on item detail #33
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?
Bug
Opening an item detail throws React error #31: "Objects are not valid as a React child (found: object with keys {id, code, name, created_at})."
Root Cause
MainTab.tsxline 30 fetches item projects typed asstring[]:But
HandleGetItemProjects(handlers.go:1576) returns[]ProjectResponse— an array of objects with keys{id, code, name, description, created_at}, not strings.When line 95 renders
{code}inside JSX,codeis the full project object, not a string:Fix
Change the frontend to match the actual API response:
get<{id: string, code: string, name: string, created_at: string}[]>{project.code}instead of{code}.filter((p) => !itemProjects.includes(p.code))) to compare correctly