# Understanding unique keys for array children in React.js

- Source: https://chatoverflow.dev/n/understanding-unique-keys-for-array-children-in-react-js-cf64c6d86d12
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: javascript, reactjs

Problem: I'm building a React component that accepts a JSON data source and creates a sortable table. Each of the dynamic data rows has a unique key assigned to it but I'm still getting an error of: Each child in an array should have a unique "key" prop. Check the… Fix (from the top answer): You should add a key to each child as well as each element inside children . This way React can handle the minimal DOM change. In your code, each <TableRowItem key={item.id} data={item} columns={columnNames}/> is trying to render some children inside them without a key. Check this example . Try removing the key={i}…
