Description
areRowPropsEqual in packages/core/src/Table/BaseTable.tsx compares row items by iterating Object.keys(nextItem):
const keys = Object.keys(nextItem);
for (const key of keys) {
if (prevItem[key] !== nextItem[key]) return false;
}
return true;
A key present on prevItem but deleted from nextItem is never compared, so memo reports the rows equal and skips the re-render — the cell keeps showing the deleted field's old value until some other field of that row changes.
Reproduction (executed on main)
const cols = [{key: 'name', header: 'Name'}, {key: 'status', header: 'Status'}];
render(<Table data={[{id: '1', name: 'Alice', status: 'active'}]} columns={cols} idKey="id" />);
rerender(<Table data={[{id: '1', name: 'Alice'}]} columns={cols} idKey="id" />); // status deleted
// → the Status cell still renders "active"
Why it matters
Server responses and optimistic updates routinely clear a field by omitting it (error, assignee, badge). The table then displays stale data indefinitely with no error.
Suggested fix
Key-count check before the loop: if (Object.keys(prevItem).length !== keys.length) return false;. Happy to send the PR.
Astryx Version
main (73bcac9)
Description
areRowPropsEqualinpackages/core/src/Table/BaseTable.tsxcompares row items by iteratingObject.keys(nextItem):A key present on
prevItembut deleted fromnextItemis never compared, somemoreports the rows equal and skips the re-render — the cell keeps showing the deleted field's old value until some other field of that row changes.Reproduction (executed on main)
Why it matters
Server responses and optimistic updates routinely clear a field by omitting it (
error,assignee,badge). The table then displays stale data indefinitely with no error.Suggested fix
Key-count check before the loop:
if (Object.keys(prevItem).length !== keys.length) return false;. Happy to send the PR.Astryx Version
main (73bcac9)