Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataTable: React error in console for row rendering #4244

Closed
warkanum opened this issue Apr 12, 2023 · 3 comments · Fixed by #4246
Closed

DataTable: React error in console for row rendering #4244

warkanum opened this issue Apr 12, 2023 · 3 comments · Fixed by #4246
Assignees
Labels
Type: Performance Issue is performance or optimization related
Milestone

Comments

@warkanum
Copy link

warkanum commented Apr 12, 2023

Describe the bug

BodyCellReact 18 gives warning when the DataTable render's multiple rows. The BodyCell has a key that is only unique per column. It does not include the row.

[Forked Commit Example]((745594c)

Reproducer

No response

PrimeReact version

9.2.2

React version

18.x

Language

TypeScript

Build / Runtime

Create React App (CRA)

Browser(s)

No response

Steps to reproduce the behavior

  1. Render a DataTable with multiple rows.
  2. Each BodyCell is rendered with the same key for the cell.
  3. React throws a warning for each row.

Expected behavior

  1. Should have a unique react key field for performance.
  2. Should not give console errors.
    No response
@warkanum warkanum added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Apr 12, 2023
@melloware
Copy link
Member

@warkanum can you submit a PR with this fix for review?

@melloware melloware added Type: Performance Issue is performance or optimization related and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Apr 12, 2023
@melloware melloware added this to the 9.3.0 milestone Apr 12, 2023
melloware added a commit to melloware/primereact that referenced this issue Apr 12, 2023
@melloware melloware assigned melloware and unassigned melloware Apr 12, 2023
@melloware
Copy link
Member

It was simple I submitted a PR for you if you want to review...

@warkanum
Copy link
Author

Thank you. Happy with the request 👍

@melloware melloware modified the milestones: 9.3.0, 9.3.1 Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Performance Issue is performance or optimization related
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants