medusajs/medusa

Duplicate React key warning in `CustomerOrderSection` due to duplicate `"actions"` column IDs

已關閉

#15,485 建立於 2026年5月24日

 (1 則留言) (0 個反應) (0 位負責人)TypeScript (2,090 個分叉)batch import
good first issuetype: bug

倉庫指標

星標
 (22,539 顆星)
PR 合併指標
 (平均合併 10天 22小時) (30 天內合併 185 個 PR)

描述

Description

While navigating to the customer detail orders table, a React warning appears in the console:

Warning: Encountered two children with the same key, `0_actions`

After tracing the issue, it seems to originate from duplicate TanStack Table display column IDs.

useOrderTableColumns already defines a display column with:

columnHelper.display({
  id: "actions",
  cell: ({ row }) => {
    return <CountryCell country={country} />
  },
})

Then CustomerOrderSection appends another display column:

columnHelper.display({
  id: "actions",
  cell: ({ row }) => <CustomerOrderActions order={row.original} />,
})

This results in duplicate column IDs inside the same table, causing TanStack Table to generate duplicate internal keys such as:

0_actions

which triggers the React warning.

Expected behavior

Column IDs should be unique.

The CountryCell display column appears to semantically represent a country/shipping country column, so renaming its ID from:

id: "actions"

to something like:

id: "country"

would likely resolve the warning.

Environment

  • Admin dashboard
  • TanStack Table

貢獻者指南