next-cloudinary
next-cloudinary copied to clipboard
Table component bugs — falsy values lost, runtime crash when columns missing, class typo, and unstable keys
This PR fixes multiple issues in next-cloudinary/docs/components/Table/Table.js:
- Preserve falsy values (like
0and empty string) in cells by only replacingnull/undefined. - Add default fallbacks for
columnsanddatato avoid runtime crashes. - Guard usage of
columnsin 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
datacontaining0and ensure0displays. - Render component with
columnsundefined and somedataand ensure no runtime error. - Verify header / cell spacing respects
last:pr-0.
Hey, are you solving this issues?
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