I using Table from ant desing. I have question about how can i re-render table datasource when i update the state ? I add state to dataSource like :
<Table
rowKey="Id"
columns={columns}
dataSource={documents.Data}
className="w-full"
/>
And after i update my state like :
const UpdateDocument = (row) => {
let fakeList = { ...documents };
let item = fakeList.Data.find((x) => x.Id === row.Id);
let index = fakeList.Data.indexOf(item);
fakeList.Data[index] = row;
setDocuments(fakeList); //I update my state here.
};
But its not re-render table datasource. After i update my state shouldn't it re-render too ? Where do i make wrong ? Thanks for replies!