question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TableRow doesn't have a key attribute!

See original GitHub issue

This causes a warning: warning: flattenChildren(…): Encountered two children with the same key, undefined. Child keys must be unique; when two children share a key, only the first child will be used.

It’s probably just react 15 thing but it is a good practice to add keys to children.

Cheers

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
innopalcommented, Oct 17, 2016

Thank you @AllenFang and @abachman.

The bug always shows up on the console. I thought I was clear about that. keyField of isKey behave the same, neither made the warning go away.

Cheers

0reactions
abachmancommented, Oct 17, 2016

@innopal in my case, I had to make sure that the dataField pointed to by the isKey TableHeaderColumn was present in the data. We were using “name” in the dataField prop, but “id” in the dataFormat of that column and our records included an id attribute but not name, so the bug only showed up in the console and not visually (on the page).

Just playing with it, it looks like using the keyField prop of the top-level BootstrapTable component will let you use any field that’s present in data, even if you don’t include it as a TableHeaderColumn.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Each record in table should have a unique `key` prop,or set ...
I'm trying to figure out how can I get unique keys for each record. So far, my code looks like this: let lastIndex...
Read more >
Each record in table should have a unique `key` prop,or set ...
Each record in table should have a unique key prop,or set rowKey to an unique primary key. solution 1. each col has a...
Read more >
<tr>: The Table Row element - HTML - MDN Web Docs - Mozilla
The HTML element defines a row of cells in a table. The row's cells can then be established using a mix of (data...
Read more >
TableRow | Android Developers
The children of a TableRow do not need to specify the layout_width and layout_height attributes in the XML file. TableRow always enforces those...
Read more >
Tables in HTML documents
11.1 Introduction to tables. The HTML table model allows authors to arrange data -- text, preformatted text, images, links, forms, form fields, other...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found