diff --git a/package.json b/package.json index 15ad77762..500246e89 100644 --- a/package.json +++ b/package.json @@ -65,8 +65,8 @@ "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^12.1.5", "@types/enzyme": "^3.10.5", + "@types/react": "^18.0.28", "@types/jest": "^29.5.0", - "@types/react": "^17.0.35", "@types/react-dom": "^18.0.5", "@types/responselike": "^1.0.0", "@types/styled-components": "^5.1.32", diff --git a/src/Cell/useCellRender.ts b/src/Cell/useCellRender.ts index 825e6c343..d181a25a9 100644 --- a/src/Cell/useCellRender.ts +++ b/src/Cell/useCellRender.ts @@ -40,7 +40,7 @@ export default function useCellRender( ? dataIndex : [dataIndex]; - const value: Record | React.ReactNode = getValue(record, path); + const value: React.ReactNode = getValue(record, path); // Customize render node let returnChildNode = value; diff --git a/src/utils/valueUtil.tsx b/src/utils/valueUtil.tsx index 90b298e0b..a70abe290 100644 --- a/src/utils/valueUtil.tsx +++ b/src/utils/valueUtil.tsx @@ -16,16 +16,16 @@ interface GetColumnKeyColumn { export function getColumnsKey(columns: readonly GetColumnKeyColumn[]) { const columnKeys: React.Key[] = []; - const keys: Record = {}; + const keys: Record = {}; columns.forEach(column => { const { key, dataIndex } = column || {}; let mergedKey = key || toArray(dataIndex).join('-') || INTERNAL_KEY_PREFIX; - while (keys[mergedKey]) { + while (keys[mergedKey as string]) { mergedKey = `${mergedKey}_next`; } - keys[mergedKey] = true; + keys[mergedKey as string] = true; columnKeys.push(mergedKey); });