mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-12 11:55:23 +08:00
fix(Table): prevent reusing row from previous render
This commit is contained in:
parent
2228e91b01
commit
2875933c99
@ -89,19 +89,21 @@ const defaultPagination = {
|
|||||||
*/
|
*/
|
||||||
const emptyObject = {};
|
const emptyObject = {};
|
||||||
|
|
||||||
let row: BodyRowClass;
|
let row: BodyRowClass | undefined;
|
||||||
|
|
||||||
const createComponents = (components: TableComponents = {}, prevComponents?: TableComponents) => {
|
const createComponents = (components: TableComponents = {}, prevComponents?: TableComponents) => {
|
||||||
const bodyRow = components && components.body && components.body.row;
|
const bodyRow = components && components.body && components.body.row;
|
||||||
const preBodyRow = prevComponents && prevComponents.body && prevComponents.body.row;
|
const prevBodyRow = prevComponents && prevComponents.body && prevComponents.body.row;
|
||||||
if (!row || bodyRow !== preBodyRow) {
|
let Row = row;
|
||||||
row = createBodyRow(bodyRow);
|
row = undefined;
|
||||||
|
if (!Row || bodyRow !== prevBodyRow) {
|
||||||
|
Row = createBodyRow(bodyRow);
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
...components,
|
...components,
|
||||||
body: {
|
body: {
|
||||||
...components.body,
|
...components.body,
|
||||||
row,
|
row: Row,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user