TableRow doesn't have a key attribute!
See original GitHub issueThis 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:
- Created 7 years ago
- Comments:5 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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
@innopal in my case, I had to make sure that the
dataField
pointed to by theisKey
TableHeaderColumn was present in the data. We were using “name” in the dataField prop, but “id” in thedataFormat
of that column and our records included anid
attribute but notname
, 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.