next-cloudinary icon indicating copy to clipboard operation
next-cloudinary copied to clipboard

Table component bugs — falsy values lost, runtime crash when columns missing, class typo, and unstable keys

Open mukeshdhadhariya opened this issue 3 months ago • 2 comments

This PR fixes multiple issues in next-cloudinary/docs/components/Table/Table.js:

  • Preserve falsy values (like 0 and empty string) in cells by only replacing null/undefined.
  • Add default fallbacks for columns and data to avoid runtime crashes.
  • Guard usage of columns in tbody.
  • Fix Tailwind class typo last pr-0 -> last:pr-0.
  • Avoid variable shadowing by renaming column index variable to colIndex.
  • Use stable row keys (row.id ?? rowIndex) instead of just rowIndex.

Testing:

  • Render table with data containing 0 and ensure 0 displays.
  • Render component with columns undefined and some data and ensure no runtime error.
  • Verify header / cell spacing respects last:pr-0.

mukeshdhadhariya avatar Oct 07 '25 18:10 mukeshdhadhariya

Hey, are you solving this issues?

mustafaazad03 avatar Oct 12 '25 13:10 mustafaazad03

yes i have already open a PR #613 there i changes two file so review that PR and also a bug in you code for that i raise a issue #612 that is also solved in PR #613 so review and merge

mukeshdhadhariya avatar Oct 12 '25 13:10 mukeshdhadhariya