-
Notifications
You must be signed in to change notification settings - Fork 377
Closed
Description
In our application, data are periodically reloaded from backend and then re-displayed. But often the data values remains the same.
The content of tbody element in DOM is always updated even if data in attribute rows stay the same
when I use the Table component.
Let's say we have the following code:
import React from "react";
import { Table, TableHeader, TableBody } from "@patternfly/react-table";
const Nodes = ({ nodeList }) => {
console.log(nodeList);
return (
<Table
aria-label="Cluster nodes"
rows={nodeList.map(node => [node.name, node.status])}
cells={["Name", "Status"]}
>
<TableHeader />
<TableBody />
</Table>
);
};
export default Nodes;The console shows that we get the same data:
(3) [{…}, {…}, {…}]
0: {name: "node-1", status: "online"}
1: {name: "node-2", status: "online"}
2: {name: "node-3", status: "offline"}
length: 3
__proto__: Array(0)
(3) [{…}, {…}, {…}]
0: {name: "node-1", status: "online"}
1: {name: "node-2", status: "online"}
2: {name: "node-3", status: "offline"}
length: 3
__proto__: Array(0)
But the DOM elements inspector indicates that content of tag tbody element is updated:
Before data arrives

Version of @patternfly/react-table is 1.0.7
Metadata
Metadata
Assignees
Labels
No labels
