Patternfly-react: Table with column 'ID' breaks React keys

Created on 17 Sep 2020  路  3Comments  路  Source: patternfly/patternfly-react

Describe the issue. What is the expected and unexpected behavior?

Expected behavior: no errors
Actual behavior: Encountered two children with the same key, [object Object]-row.

https://codesandbox.io/s/youthful-noyce-s1bwg?file=/index.js

Is this a bug or enhancement? If this issue is a bug, is this issue blocking you or is there a work-around?

Bug. Don't know what's the workaround apart from renaming the column which one shouldn't have to do.

bug pinned

Most helpful comment

@mohd-akram I had the same issue some months ago https://github.com/patternfly/patternfly-react/issues/3090

There is a clean workaround there which I think it's easy to implement to avoid rewriting this component's code.

All 3 comments

@mohd-akram I had the same issue some months ago https://github.com/patternfly/patternfly-react/issues/3090

There is a clean workaround there which I think it's easy to implement to avoid rewriting this component's code.

+1 to this - although a workaround exists, there could be a fix in the resolve-row-key to avoid this

Duplicate of #3090 and #4283 which we never resolved. I think our workarounds are fine, but we should modify one of our examples to add an id column.

Was this page helpful?
0 / 5 - 0 ratings